【发布时间】:2021-03-09 10:48:09
【问题描述】:
所以我正在尝试下载一个在弹出窗口中打开的 pdf 文件,像这样。
在此处使用此代码获取弹出窗口并将其下载到“./”。
const popUp = await popUpPromise
await popUp.waitFor(5000)
// await popUp.waitForSelector('.content')
const pdf = await popUp.$$eval('html', e => e)
await console.log(pdf)
await popUp._client.send('Page.setDownloadBehavior', {behavior: 'allow', downloadPath: './'})
但它不仅没有像我预期的那样下载,而且弹出窗口中的 html 返回为空。
【问题讨论】:
标签: node.js pdf web-scraping puppeteer