I’m using the puppeteer package for web scraping in local server evrythings working fine bcuz local machine has chrome browser
but when i deployed the same code into the aws ecs container but having this error
error at web scrapping data Error: Failed to launch the browser process! spawn /tmp/chromium ENOENT
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.mdat onClose (/usr/src/app/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)
2024-05-21T04:38:27.612Z at ChildProcess.<anonymous> (/usr/src/app/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:293:24)
at ChildProcess.emit (node:events:517:28)
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
this is the sample code for browser
puppeteerExtra.use(StealthPlugin())
const browser = await puppeteerExtra.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(),
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
I also updated my docker file for installed chrome package
RUN apk update && apk upgrade &&
echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories &&
echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories &&
apk add --no-cache
chromium@edge
nss@edge
freetype@edge
harfbuzz@edge
ttf-freefont@edge
ENV CHROME_BIN=/usr/bin/chromium-browser
RUN $CHROME_BIN --version
RUN apk add --no-cache
udev
ttf-opensans
nodejs
npm
what should I do now?