page.goto returns null periodically
See original GitHub issueSteps to reproduce
Similar/same as: #1391
Tell us about your environment:
- Puppeteer version: 1.3.0
- Platform / OS version: Mac
- URLs (if applicable): https://www.microsoft.com/en-gb/store/d/xbox-one-s-1tb-console-playerunknowns-battlegrounds-bundle/908z9jn5cnh2/gz4w?cid=msft_web_collection
- Node.js version: 9.11.1
What steps will reproduce the problem?
const browser = await puppeteer.launch();
const page = await browser.newPage();
for (var i = 0; i < 15; i++) {
const r = await page.goto('https://www.microsoft.com/en-gb/store/d/xbox-one-s-1tb-console-playerunknowns-battlegrounds-bundle/908z9jn5cnh2/gz4w?cid=msft_web_collection', { waitUntil: 'domcontentloaded' });
console.log(r.ok());
}
await browser.close();
What is the expected result?
true
outputted 15 times
What happens instead?
Sometimes true
15 times, sometimes TypeError: Cannot read property 'ok' of null
It works as expected on 1.2.0, but fails on 1.3.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:27 (7 by maintainers)
Top Results From Across the Web
Puppeteer - Returning null content to my scrape - Stack Overflow
The page.waitForSelector() method returns the ElementHandle if it finds the element, otherwise it throws an error. As such, we can use this ...
Read more >Puppeteer documentation - DevDocs
Defaults to false . defaultViewport <?Object> Sets a consistent viewport for each page. Defaults to an 800x600 viewport. null disables the default viewport....
Read more >utils.puppeteer - Apify SDK
Extended version of Puppeteer's page.goto() allowing to perform requests with ... null = null - Name or id of the Key-Value store where...
Read more >API Reference — Pyppeteer 0.0.25 documentation
Navigate to the previous page in history. Available options are same as goto() method. If cannot go back, return None .
Read more >Page | Playwright - CukeTest
newPage(); await page.goto('https://example.com'); await page.screenshot({path: ... If no elements match the selector, the return value resolves to null .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a bit of a workaround until this is fixed:
This will return the first response you’re getting once interception starts. This will NOT return the intial request you’re actually looking. So if you actually need that request, you’re out of luck unless you use an incognito tab.