Return null response on page with redirect
See original GitHub issueI checked many similar issues including #2479 #4970 #1729 but no workaround or merged fix worked.
Steps to reproduce
Tell us about your environment:
- Puppeteer version: 1.20
- Platform / OS version: tested on Mac OS 10.13.6 and Last Amazon Linux 2 in Docker
- URLs (if applicable): http://www.faalkaart.nl
- Node.js version: v12.4.0
What steps will reproduce the problem?
Please include code that reproduces the issue.
Run this code:
const puppeteer = require('puppeteer');
const url = 'http://www.faalkaart.nl';
// const url = 'https://basisbeveiliging.nl/'; // with this it works
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// The following shows that redirection are followed:
// await page.setRequestInterception(true);
// page.on('request', r => { console.log(r._url); r.continue() });
const response = await page.goto(url, {
timeout: 15000,
waitUntil: ['domcontentloaded', 'networkidle0']
});
// await page.waitFor(5000); // If we intercept request and wait we can see that the page is loaded but the context had been lost since response is null
if (response) {
console.log('Response is OK');
} else {
console.log('Response is null');
}
await browser.close();
})();
What is the expected result?
Response is OK
What happens instead?
Response is null
Some ideas about the cause
Intercepting request I was able to see that redirection chain is
- http://www.faalkaart.nl/
- http://faalkaart.nl/
- https://faalkaart.nl/ <— domcontentloaded is triggered after this one
- https://basisbeveiliging.nl/ <— networkidle0 is triggered after this one
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Return null response on page with redirect #5011 - GitHub
launch(); const page = await browser. newPage(); // The following shows that redirection are followed: // await page. setRequestInterception( ...
Read more >Redirect null fetch request - javascript - Stack Overflow
A value is passed through a search bar on the webpage, which is appended to a URL and used to fetch JSON data....
Read more >Request,query string return null values in page redirect
Hi, You have called the function 'resettext();' before Response.Redirect. I think it will clear the textbox content.
Read more >Response.Redirect and Request.UrlReferrer - MSDN - Microsoft
I have this page, say page1.aspx. I want to check from which page the user was redirected to page1. On page1 page_load I...
Read more >Lambda@Edge example functions - Amazon CloudFront
The following example shows how to generate an HTTP redirect response with a country-specific URL and return the response to the viewer. This...
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
We’re marking this issue as unconfirmed because it has not had recent activity and we weren’t able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!