gajus/puppeteer-proxy
在 GitHub 查看Puppeteer bug prevents this library from working with sites that use `request.clone()`
Open
#14 创建于 2020年7月28日
bughelp wanted
仓库指标
- Star
- (214 star)
- PR 合并指标
- (PR 指标待抓取)
描述
As documented here, Puppeteer has a bug where postData isn't available on cloned requests. I realize this is an upstream bug, but if it directly impacts ability to use this library, so I'm documenting it here.
This means that if a website uses popular libraries like KY to send POST requests, you will not be able to use puppeteer-proxy to reconstruct that call. Puppeteer will successfully execute the POST if the request is not intercepted, but it be undefined if intercepted and inspected.
await page.setRequestInterception(true)
page.on('request', async request => {
// this will log 'undefined' for requests that were created with request.clone() on the page
logger.info(request.postData())
request.continue()
})