-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Redirect stops before the final destination that has an error Name Not Resolved #12343
Comments
This issue has an outdated Puppeteer version: |
There is no expectation from Puppeteer here to return the last response URL, we return the one the user tried to navigate to. let lastNavigationRequest;
page.on('request', req =>{
//...
if (req.isNavigationRequest() && req.frame() === page.mainFrame()) {
lastNavigationRequest = req;
}
// Prevent the error form throwing
await page.goto(...).catch(() => {});
console.log(lastNavigationRequest.url());
}) Currently Puppeteer does not provide a means to get the request from a failed navigation directly from the |
@Lightning00Blade Thanks for your reply however I think there was a misunderstood about the nature of the bug i'm referring to. For the error : Name Not Resolved , i don't want to get rid of it, in fact, i want to know where exactly in URL's chain it happened, which logically MUST be in the last url that appears. But when i catch the error while navigation, it shows that the error of Name Not Resolved has appeared in the url before final destination ( which is wrong ) |
How |
Minimal, reproducible example
Error string
net::ERR_NAME_NOT_RESOLVED
Bug behavior
Background
It happens with this URL:
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://tinyurl.com/mlkdaylunch&ved=2ahUKEwjAxbnrp9iFAxWA9gIHHSiSBMsQFnoECBQQAQ&usg=AOvVaw1zSAE11qJ2cPYgP22N71-M
When printing requests URL's, it does reach the final destination https://una.presence.io/form/mlk-day-lunch which is an invalid url that must show the error : net::ERR_NAME_NOT_RESOLVED . But the problem it's showing that the URL before it https://tinyurl.com/mlkdaylunch that has the error of : net::ERR_NAME_NOT_RESOLVED. Which results to not show the final url destination in response interceptor.
In fact, when you try to start page.goto from the before final url : https://tinyurl.com/mlkdaylunch, it will work fine and shows that the url that comes after it is not resolved ( which is correct )
Expectation
net::ERR_NAME_NOT_RESOLVED at https://una.presence.io/form/mlk-day-lunch
Reality
net::ERR_NAME_NOT_RESOLVED at https://tinyurl.com/mlkdaylunch
Puppeteer configuration file (if used)
Puppeteer version
21.10.0
Node version
18.17.0
Package manager
npm
Package manager version
9.6.7
Operating system
macOS
The text was updated successfully, but these errors were encountered: