I am encountering difficulties with running puppeteer
on my Raspberry Pi Zero, following the steps outlined in this tutorial.
Here is what I have attempted so far:
$ sudo apt-get install chromium-browser chromium-codecs-ffmpeg --yes
$ npm init -Y
$ npm install <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f1f1a1f1f0a1b0a0a1d420c001d0a2f5e415e5e415f">[email protected]</a>
I also tried installing without specifying the core version (1.11.0) but encountered the same issues.
This is my index.js
file:
const puppeteer = require('puppeteer-core');
(async () => {
try {
const browser = await puppeteer.launch({ executablePath: 'chromium-browser', headless: true, product: 'chrome' });
const page = await browser.newPage();
page.setDefaultNavigationTimeout(25 * 1000);
await page.goto('https://www.google.com/');
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
console.log('Screenshot taken');
} catch (e) {
console.log(e.message);
}
})();
When I run it, I encounter a timeout error:
$ node index.js
Navigation Timeout Exceeded: 25000ms exceeded
It simply hangs and doesn't exit.
Any assistance would be greatly appreciated. Thank you.