Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running chrome headless on linux without xorg

Is it possible to install and run chrome headless on a headless Linux box without installing the audio and xorg dependencies?

If not, then is there a special headless build of chrome/chromium which doesn't pull xorg and audio libs?

like image 925
ccpizza Avatar asked Oct 30 '17 11:10

ccpizza


People also ask

How do I run Chrome headless in Linux?

You can run Google Chrome in headless mode simply by setting the headless property of the chromeOptions object to True. Or, you can use the add_argument() method of the chromeOptions object to add the –headless command-line argument to run Google Chrome in headless mode using the Selenium Chrome web driver.

How do I run Chrome in headless mode?

Which command starts the google chrome web browser in headless mode? As we have already seen, you just have to add the flag –headless when you launch the browser to be in headless mode. With CLI (Command Line Interface), just write: chrome \<br> – headless \ # Runs Chrome in headless mode.

Does Chromium support headless?

Headless Chromium allows running Chromium in a headless/server environment. Expected use cases include loading web pages, extracting metadata (e.g., the DOM) and generating bitmaps from page contents -- using all the modern web platform features provided by Chromium and Blink.

How do I use Chromium puppeteer instead of Chrome?

By default, Puppeteer downloads and uses a specific version of Chromium so its API is guaranteed to work out of the box. To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a Browser instance: const browser = await puppeteer.


1 Answers

This troubleshooting doc on puppeteer should be of some help (https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md), it oultlines all the package necessary for running Chrome on a linux machine (more specifically for web servers).

Depending on your end-goal, I wrote a service that provides access to headless Chrome at https://browserless.io. More or less treats Chrome in hosted fashion, so you don't have to try and get it running yourself, which is a time consuming process.

In any case, hope one of those helps!

like image 60
browserless Avatar answered Nov 06 '22 00:11

browserless