【发布时间】:2017-11-12 07:57:05
【问题描述】:
我尝试像这样将浏览器与 wsendpoint 连接:
(async () => {
const browser = await puppeteer.connect({browserWSEndpoint: 'ws://localhost:9222/devtools/page/eedbdd50-cd25-472d-a701-a0302d9ffe2f'});
const page = await browser.newPage();
await page.goto('https://www.google.com.tr');
})();
此代码可以打开新标签,但不要转到链接。它给出错误:
(node:2022) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Protocol error (Performance.enable): 'Performance.enable' wasn't found undefined
(node:2022) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
【问题讨论】:
标签: node.js google-chrome-headless puppeteer