Skip to content

Commit

Permalink
adds safety measure to wait for selector before scraping
Browse files Browse the repository at this point in the history
  • Loading branch information
jackHedaya committed Jul 30, 2019
1 parent 757d693 commit acbaf66
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class RealtimeStock extends EventEmitter {
this.emit("debug", `Skipping resource of type '${resourceType}' while accessing ${s} price.`)
);

await page.waitForSelector("#quote-market-notice")
const price = await scrapePrice(page);

await page.close();
Expand Down

0 comments on commit acbaf66

Please sign in to comment.