Single Blog

Puppeteer en Raspbian NodeJS

1 octubre, 2022, Written by 0 comment
npm i puppeteer
# or "yarn add puppeteer"
const puppeteer = require('puppeteer');

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(‘’);
await page.screenshot({path: ‘example.png’});

await browser.close();

Error: Failed to launch chrome!
/home/xxxx/.../node_modules/puppeteer/.local-chromium/liniux-641577/chrome-linux/chrome: Syntax error: word unexpected (expecting ") "

Resolver el problema

Si está utilizando un procesador ARM, por ejemplo, Raspberry PI, como se muestra arriba, resolví el problema con el siguiente comando:

const browser = await puppeteer.launch({
headless: true,
executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox']
Paulette M

Leave a reply

Your email address will not be published. Required fields are marked *