question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

page.goto() method generates `Error: net::ERR_CONNECTION_RESET` error

See original GitHub issue

Steps to reproduce

My environment: (also, I got the same error on https://try-puppeteer.appspot.com/)

Reproduce the problem:

const browser = await puppeteer.launch();

const page = await browser.newPage();
await page.goto('http://www.personalentwicklungsberatung.de/Arbeitszeugnis/Arbeitszeugnis_-_Bewertungen/arbeitszeugnis_-_bewertungen.html');

console.log(await page.content());
await page.screenshot({path: 'screenshot.png'});

await browser.close();

After running the code block above, I got Error: net::ERR_CONNECTION_RESET error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

48reactions
alirezadarbancommented, Nov 12, 2018

That’s the website server rejecting chrome headless as a client.

I fixed this problem! I changed userAgent in the headers. By that, website server assumed it was a request from a browser and everything is OK!

(async function main() {
    try {
        const browser = await puppeteer.launch({headless: true});
        const page = await browser.newPage();
        await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3419.0 Safari/537.36');
        await page.goto('http://example.com');
         //your code
         await browser.close();
    }
    catch(e){
        console.log(e);
    }
})();
28reactions
aslushnikovcommented, Jan 12, 2018

That’s the website server rejecting chrome headless as a client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the "ERR_CONNECTION_RESET" Error (5 Ways)
If you run into the “ERR_CONNECTION_RESET” error, it means that your browser can't establish a connection to the remote server. In most cases, ......
Read more >
How to get around Error: net::ERR_CONNECTION in Puppeteer
You're using low-quality public proxies and it's only natural that they will generate network errors and/or be blocked by Google.
Read more >
How to Fix the ERR_CONNECTION_RESET Error in 7 Ways
7 Methods to Fix the ERR_CONNECTION_RESET Error · 1. Check If the Website Is Working · 2. Disconnect from VPN · 3. Reboot...
Read more >
Developers - page.goto() method generates `Error: net
page.goto() method generates `Error: net::ERR_CONNECTION_RESET` error ... (also, I got the same error on https://try-puppeteer.appspot.com/).
Read more >
ERR_CONNECTION_RESET: How to fix the Chrome ... - IONOS
Connection errors such as the 101 error can often be fixed by rebooting the network device that connects you to the internet. Most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found