Category : puppeteer

I’m using a lib called ‘node-html-to-image‘ locally it works normal, when I go up with the docker I always have a problem with the docker: Error: Unable to launch browser, error message: Failed to launch the browser process! spawn /app/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome ENOENT I’m having this error already tried to follow several tips that the lib of ..

Read more

I want to take a screenshot of a web page with a 3D canvas like this: import {createServer} from ‘http’ import puppeteer from ‘puppeteer’ const url = "https://webglfundamentals.org/webgl/webgl-load-obj-w-extents.html"; async function main() { const browser = await puppeteer.launch({ args: [ "–no-sandbox", "–use-gl=swiftshader", "–enable-webgl", ], headless: true, dumpio: true, defaultViewport: { width: 400, height: 300 }, }); ..

Read more

Getting some errors after I’ve wrapped my Playwright project in a Docker image. I’m using Firefox in Playwright. Dockerfile FROM mcr.microsoft.com/playwright:next WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npx playwright install CMD ["node","index.js"] Package.json dependencies "@extra/humanize": "^4.2.2-next.616", "playwright": "^1.15.0", "playwright-extra": "^4.2.1-next.616" index.js const { firefox } = require(‘playwright’); (async ..

Read more

I am using Bazel to build and deploy Docker containers to my Kubernetes cluster: const url = "https://www.w3schools.com/html/html5_canvas.asp"; const browser = await puppeteer.launch({ args: [ "–disable-gpu", "–disable-dev-shm-usage", "–disable-setuid-sandbox", "–no-sandbox", ], headless: true, dumpio: true, }); const page = await browser.newPage(); await page.goto(url); const base64Image = await page.evaluate(() => { const canvas = document.querySelector("#myCanvas6"); return (canvas ..

Read more

I am trying to measure width of the element using puppeteersharp in lambda and docker. Simple code gives diffrent results on win & linux. var res = await node.EvaluateFunctionAsync<int>("element => parseFloat(window.getComputedStyle(element).width)"); Adding sample project. test-lambda-chrome.zip When i run it from VS2019 on Windows 10 – F5 – i get result – 643 When i build ..

Read more

I have dockerized two services: web frontend(containing the gui in angular accessed on port 3000) backend(that has puppeteer dependency for extracting data from a web page accessed on port 8111) Below is the simplified version dockerfile for the backend: FROM private/node:v10.22.1 # Dependencies needed for backend (removed for simplicity) RUN apt-get update RUN apt-get install ..

Read more

Part of my docker file: # Install Chrome to get all of the dependencies installed ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm chrome.rpm RUN yum install -y ./chrome.rpm Lambda on .net core: using var browser = await Puppeteer.LaunchAsync(new LaunchOptions { UserDataDir = "/tmp", Headless = true, DefaultViewport = Constants.ViewPort, DumpIO = true, Args = new[] { "–no-sandbox", "–disable-setuid-sandbox", }, ExecutablePath ..

Read more