sup3rgiu / PoliDown

Save Microsoft Stream videos uploaded by Politecnico di Milano.
MIT License
78 stars 13 forks source link

Headless mode not working #39

Open simoconfa opened 4 years ago

simoconfa commented 4 years ago

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 (???)

alessionossa commented 3 years ago

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

kuro7766 commented 3 years ago

same problem with chromium