Coder Social home page Coder Social logo

Comments (4)

ArneTR avatar ArneTR commented on August 26, 2024 1

I gave it a spin. The executable path is not set correctly.

Try this:

puppeteer = require('puppeteer');

(async () => {
  // Launch the browser and open a new blank page
  const browser = await puppeteer.launch({
    executablePath: "/usr/bin/chromium-browser",
    args: [ '--disable-gpu', '--disable-setuid-sandbox', '--no-sandbox', '--headless', ]
  });
  const page = await browser.newPage();

  // Navigate the page to a URL
  await page.goto('https://todo-app:3000/');
})();

This should at least open the browser. Connecting to the domain I did not check. Hopefully this gets you to the next step.

from green-metrics-tool.

ArneTR avatar ArneTR commented on August 26, 2024

What base OS are you running on and what architecture do you have?

We have seen this error before when running puppeteer on a macOS or windows system and/or on a non-x64 architecture.

The base image we provide under greencoding/puppeteer-chrome is only build for amd64. If you are running an arm system or under macOS / windows I suggest you rather use our Playwright container with python bindings. See an example where we use it here

However you are also free to use any other puppeteer / playwright container. Our tool is agnostic in that.
You should just verify that you can start the puppeteer / playwright with the container normally on your system by entering the container and starting the browser process directly in headless mode.

Hope this helps. Please follow up if not with more details.

from green-metrics-tool.

hellstromme avatar hellstromme commented on August 26, 2024

Ah, apologies, I should have included that detail.

I'm running Linux Mint 21.2 Cinnamon on an old laptop with a Intel Core 5-4210U CPU @ 1.70GHz. I tried a variety of puppeteer containers and got similar errors.

from green-metrics-tool.

hellstromme avatar hellstromme commented on August 26, 2024

Yes, that worked - thank you! :)

from green-metrics-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.