Installing headless chrome on Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from https://chromium.woolyss.com/ | |
# and https://gist.github.com/addyosmani/5336747 | |
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
sudo apt-get update | |
sudo apt-get install chromium-browser | |
chromium-browser --headless --no-sandbox http://example.org/ |
sorry i also found it somewhere, lost track of it haha
I am on a ubuntu ...
and i cant make it work :(
npx lighthouse --chrome-flags='--headless' --quiet --no-update-notifier --no-enable-error-reporting --output=json --throttle --stop --preset=desktop --output-path=\nytimes_com\2022_05_15_01_32_43_R_1_nytimes_com_desktop.json https://www.nytimes.com/
Unable to connect to Chrome
are you running in docker?
@phd I am more than happy to update my comment. Would you mind providing me a full command so that I can copy & paste as I won't be able to test it anymore?
sudo add-apt-repository ppa:phd/chromium-browser
echo '
Package: *
Pin: release o=LP-PPA-phd-chromium-browser
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/phd-chromium-browser
sudo apt update
sudo apt install -y chromium-browser
@phd Done, thank you!
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@u007 you are a hero, it also works on Ubuntu 20.04