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

Connecting Puppeteer to a Chrome-Launcher instance. #2790

Closed
rlpham opened this issue Jun 21, 2018 · 3 comments
Closed

Connecting Puppeteer to a Chrome-Launcher instance. #2790

rlpham opened this issue Jun 21, 2018 · 3 comments

Comments

@rlpham
Copy link

rlpham commented Jun 21, 2018

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: v1.5.0
  • Platform / OS version: Mac OS X El Capitan v10.11.6
  • URLs (if applicable):
  • Node.js version: v10.2.1

What steps will reproduce the problem?
1.
const chromeLauncher = require('chrome-launcher');
const puppeteer = require('puppeteer');
const request = require('request');
const util = require('util');

(async() => {

const chrome = await chromeLauncher.launch({
startingUrl: 'http://www.google.com'
});

const resp = await util.promisify(request)(http://localhost:${chrome.port}/json/version);
const {webSocketDebuggerUrl} = JSON.parse(resp.body);
const browser = await puppeteer.connect({
browserWSEndpoint: webSocketDebuggerUrl
});
const page = browser.newPage();

})();

What is the expected result?
Puppeteer connects with the chrome launcher instance and creates a new page.

What happens instead?
Stays on starting url (google.com) unsure if it is actually connected to it or not.

@aslushnikov
Copy link
Contributor

This should work. Make sure chrome launcher launches Chrome 69; otherwise, things won't work.

@MeetPatel5
Copy link

I am still not getting , how to connect puppeteer with chome instace ? give me live example with that open third-party website using browser instace (if possible !)

@ebidel
Copy link
Contributor

ebidel commented Dec 12, 2018 via email

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

No branches or pull requests

4 participants