PoliDown icon indicating copy to clipboard operation
PoliDown copied to clipboard

Headless mode not working

Open simoconfa opened this issue 4 years ago • 2 comments

As title said, the script does not work on Windows when headless: true Switching it to: headless: false makes it work.

In particular the script stuck at networkidle2: await page.goto('https://web.microsoftstream.com/', { waitUntil: 'networkidle2' }); After 30s I got timeout exception. I tried changing it into: await page.goto('https://web.microsoftstream.com/', { waitUntil: 'domcontentloaded' }); but the script goes on a bit and then it stuck after on this line: await page.waitForSelector('input[id="login"]' with another timeout exception.

It seems that the browser have a different behavior when is in headless mode: https://github.com/puppeteer/puppeteer/issues/665#issuecomment-327258632 The comment above suggest to change user agent when you are in headless mode. Maybe an additional window appears, or Polimi prevents bots from login (???)

simoconfa avatar Aug 30 '20 14:08 simoconfa

I'm experiencing the same issue with a script that worked well for months. I think it’s caused by some changes in Chromium

alessionossa avatar Sep 16 '20 14:09 alessionossa

same problem with chromium

kuro7766 avatar Feb 10 '21 12:02 kuro7766