I'm using Puppeteer to take full size screenshots in headful mode, as I need to interact with the browser most of the time. It runs perfectly but I noticed something odd: when the screenshot is called, it reloads the page so what I get on the capture is not always what I see in the browser.
For instance let's take this URL. If I want to display the Eiffel tower, I need to click on the slide show. No problem so far. But as soon as the screenshot is taken, the page is refreshed and goes back to the initial picture with the woman in the sofa... I have no idea what causes this behaviour.
This is my code:
const puppeteer = require('puppeteer');
args=['--window-size=1920,1080'];
const browser=await puppeteer.launch({ headless: false, defaultViewport: null, args);
const page=(await browser.pages())[0];
await page.goto('https://url.com');
await page.waitForTimeout(10000); // 10 sec timeframe to allow navigation
await page.screenshot({path: 'test.png', quality: 100, fullPage: true});
await browser.close();
I run the last version of Puppeteer (13.1.1) on a Debian 10 Linux server. Tested a lot of combinations, different arguments, timers, resolutions, etc. to no avail. Any suggestions?