browser.newPage() is blocked with puppeteer.connect()
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 0.13 + current master branch
- Platform / OS version: Debian Stretch
- Uses chrome headless from Docker
What steps will reproduce the problem?
/* eslint-disable no-console, filenames/match-regex, import/no-commonjs */
/**
* @file Ensure that Chrome can properly start and close.
*/
const puppeteer = require('puppeteer');
const test = async () => {
console.log('Testing if Chrome works');
const browser = await puppeteer.connect({
browserWSEndpoint: 'ws://192.168.200.200:9222/devtools/browser/36b65179-51a0-402b-9dd4-096c808a67c7'
});
console.log('Hello! 1');
const page = await browser.newPage();
console.log('Hello! 2');
const navigationPromise = page.waitForNavigation();
console.log('Hello! 3');
await page.goto('http://perdu.com/');
console.log('Hello! 4');
await navigationPromise;
console.log('Hello! 5');
console.log(await page.content());
console.log('Hello! 6');
await browser.close();
console.log('Chrome is working expected.');
};
test();
What is the expected result?
Like in 0.10.0
Testing if Chrome works
Hello! 1
Hello! 2
Hello! 3
Hello! 4
Hello! 5
<html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2><strong><pre> * <----- vous êtes ici</pre></strong>
</body></html>
Hello! 6
Chrome is working expected.
What happens instead?
Testing if Chrome works
Hello! 1
And the process is blocked…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
browser.newPage() is blocked with puppeteer.connect() #1450
The browser.newPage() hangs because you use old version of chromium. If you absolutely can't use the bundled chromium, try using older pptr / ......
Read more >Puppeteer blocked at .newPage() - node.js - Stack Overflow
I have fixed the issue of my case: Use dumpio: true to display log of Puppeteer. After that, I found the error with...
Read more >Avoid being blocked with puppeteer - Cobalt Intelligence
Puppeteer stealth is a great tool to help you avoid being blocked while web scraping with puppeteer. Easy to use and is very...
Read more >Web Scraping with a Headless Browser: A Puppeteer Tutorial
In this article, Toptal Freelance JavaScript Developer Nick Chikovani shows how easy it is to perform web scraping using a headless browser.
Read more >Puppeteer-extra NPM - npm.io
ConnectOptions? See puppeteer docs. Returns: Promise<Puppeteer.Browser>. Attach Puppeteer to an existing Chromium instance. Augments the original puppeteer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 same issue with latest chrome stable (tried on latest canary chromium too) launched headless, on Ubuntu 16.04. Note that it works fine with puppeteer 0.12.0.
@yijiem you can install specific version using
npm install puppeteer@1.2.0