attach to previously opened puppeteer driver

牧云@^-^@ 提交于 2019-12-04 11:36:38
elena

For those who stumble upon this, here's an example of how I've got it working:

const puppeteer = require('puppeteer');

puppeteer.connect({"browserWSEndpoint" : "ws://some_string"}).then(async browser => {
    console.log("bla bla");
    ...
});

The browser.wsEndpoint you can find from the previous session:

const endpoint = browser.wsEndpoint();

Browser websocket endpoint which can be used as an argument to puppeteer.connect.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!