Skip to content

Trying to get headless driver working #1

Trying to get headless driver working

Trying to get headless driver working #1

name: CI
on: [push]
jobs:
build:
runs-on: [ubuntu-latest]
steps:
- name: Install Selenium
run: |
sudo pip3 install selenium
- name: ChromeWebDriver
run: |
cat <<EOF >> test.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless")
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('disable-infobars')
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options, executable_path='/usr/bin/chromedriver')
driver.get("http://github.com/")
print ('Page title is ' + driver.title)
EOF
python3 test.py