Skip to content

Instantly share code, notes, and snippets.

@neomadara
Created August 25, 2018 04:29
Show Gist options
  • Save neomadara/e1540c30f709c06aae5056a085c67341 to your computer and use it in GitHub Desktop.
Save neomadara/e1540c30f709c06aae5056a085c67341 to your computer and use it in GitHub Desktop.
crash chrome
#!/usr/bin/env python3
import subprocess
from selenium import webdriver
some_site = 'http://www.google.com'
chromedriver_path = '/usr/lib/chromium-browser/chromedriver'
# Block until Chromium finishes launching and self-terminates
subprocess.run(['chromium-browser', '--headless', '--disable-gpu', '--dump-dom', 'about:blank'])
browser = webdriver.Chrome(executable_path=chromedriver_path)
browser.get(some_site)
# Continue on with your Selenium business...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment