Skip to content

Instantly share code, notes, and snippets.

@duhaime
Last active February 16, 2023 23:19
Show Gist options
  • Save duhaime/ab62295f6aedb9c2300471afd5ae7ef9 to your computer and use it in GitHub Desktop.
Save duhaime/ab62295f6aedb9c2300471afd5ae7ef9 to your computer and use it in GitHub Desktop.
Python Selenium Headless Chrome OSX
from selenium import webdriver
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")
@wastella
Copy link

Thank You so much, this is amazing. I needed this so much

@burnedsap
Copy link

Thank you!

@axlroden
Copy link

I'm sure you are using Keys somewhere, but not in this example..

@duhaime
Copy link
Author

duhaime commented Mar 31, 2021

haha you're right! I removed the unneeded line :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment