Skip to content

Instantly share code, notes, and snippets.

@krared
Forked from duhaime/headless.py
Created August 26, 2019 07:43
Show Gist options
  • Save krared/e3cfac3774775d587582580c98f1bb69 to your computer and use it in GitHub Desktop.
Save krared/e3cfac3774775d587582580c98f1bb69 to your computer and use it in GitHub Desktop.
Python Selenium Headless Chrome OSX
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver', chrome_options=chrome_options)
driver.get("http://www.duo.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment