admin管理员组文章数量:1287636
I am using puppeteer
to load a web page.
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', (request) => {
console.log(request.url())
request.continue();
...
}
}
await page.goto(
'',
{ waitUntil: 'networkidle2' },
);
I set the request interception to true
and log all requests urls. The requests I logged is a lot less than the requests when I load the url in chrome browser.
At least there is one request which can be found in chrome dev tool console but not show in above code.
I wonder how I can log all requests?
I am using puppeteer
to load a web page.
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', (request) => {
console.log(request.url())
request.continue();
...
}
}
await page.goto(
'https://www.onthehouse..au/property-for-rent/vic/aspendale-gardens-3195',
{ waitUntil: 'networkidle2' },
);
I set the request interception to true
and log all requests urls. The requests I logged is a lot less than the requests when I load the url in chrome browser.
At least there is one request https://www.onthehouse..au/odin/api/positeSearch
which can be found in chrome dev tool console but not show in above code.
I wonder how I can log all requests?
Share Improve this question edited Jun 12, 2020 at 12:58 reymon359 1,3302 gold badges18 silver badges37 bronze badges asked Jun 12, 2020 at 6:20 Joey Yi ZhaoJoey Yi Zhao 42.6k87 gold badges352 silver badges657 bronze badges 3-
Isn't your Chrome DevTools Network records some 3rd party requests (e.g. Chrome addons) as well? I pared your script's requests and the page's network traffic in Chrome and for me they match in 100%. I see no more requests in Chrome. Edit: Nevermind, I get the "Access Denied" page, so I am unable to tell
本文标签: javascriptHow can I get all xhr calls in puppeteerStack Overflow
版权声明:本文标题:javascript - How can I get all xhr calls in puppeteer? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741314425a2371832.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论