Comments (4)
This issue has an outdated Puppeteer version: 21.10.0
. Please verify your issue on the latest 22.7.1
version. Then update the form accordingly.
from puppeteer.
There is no expectation from Puppeteer here to return the last response URL, we return the one the user tried to navigate to.
You could work around this by:
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 page.goto()
command.
from puppeteer.
@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 )
from puppeteer.
How puppeteer
works is that is sends a command and it fails due to request being canceled,
in such cases we don't try to find the HTTP response associated with the error as we get it from the command.
There is a feature request to support getting the last response from the page #11555
But this is already achievable through page.on('request')
with example above given.
from puppeteer.
Related Issues (20)
- "[network.spec] network Request.resourceType should work for document type" is flaky in firefox
- ignoreHttpsErrors should be renamed to acceptInsecureCerts
- Node process is hanging after all bidi tests are finished HOT 1
- AWS lambda: running puppeteer-core 21.5.2 and @sparticuz/chromium 118.0.0 on node 18 runtime failes ONLY when my html (for PDF rendering) contains https HOT 1
- [Bug]: the parameter outline in page.pdf seems not work HOT 6
- [Bug]: PDF page numbers no longer working in headless: shell HOT 3
- [Bug]: Install error HOT 2
- [Bug]: After deployment on server the service crashes for 5-10 concurrent users. HOT 2
- Chrome Canary test results HOT 27
- [Bug]: HOT 1
- [Bug]: HOT 7
- [Feature]: Add ability to exclude web sockets from WaitForNetworkIdle HOT 1
- Error: Passed function cannot be serialized! HOT 5
- [Bug]: Navigation failed because browser has disconnected! HOT 2
- Test "[click.spec] Page.click should click the button with fixed position inside an iframe" is flaky
- [Bug]: Failed to launch browser process. HOT 2
- Failed to launch the browser process! on WSL but working on local HOT 2
- HTTPRequest is checking for chrome-only error message "Invalid header" HOT 2
- [Typo] Docs have a misspelling in arhicture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppeteer.