Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connect support #9

Merged
merged 1 commit into from
Jun 7, 2018
Merged

Add connect support #9

merged 1 commit into from
Jun 7, 2018

Conversation

berstend
Copy link
Owner

@berstend berstend commented Jun 6, 2018

No description provided.

@berstend berstend merged commit 2f8db9c into master Jun 7, 2018
@berstend berstend deleted the add-connect-support branch June 7, 2018 00:52
@huanganqing
Copy link

Sorry but it seems not support browserless with ws. I got the following error:

(node:81727) UnhandledPromiseRejectionWarning: TypeError: page.browser is not a function at Plugin.onPageCreated (/Users/chandler/projects/wondershare/aps_crawler/nodejs/node_modules/puppeteer-extra-plugin-anonymize-ua/index.js:42:25) at Plugin._onTargetCreated (/Users/chandler/projects/wondershare/aps_crawler/nodejs/node_modules/puppeteer-extra-plugin/dist/index.cjs.js:518:28) at process._tickCallback (internal/process/next_tick.js:68:7) (node:81727) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:81727) [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.

by using code as follow:

const puppeteer = require("puppeteer-extra")
const pluginStealth = require("puppeteer-extra-plugin-stealth")
puppeteer.use(pluginStealth());
const browser = await puppeteer.connect({browserWSEndpoint: this.browserWSEndpoint});
let page = await browser.newPage();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants