Created
November 21, 2017 06:52
-
-
Save cuuupid/c1760fc50547244162311d649d821566 to your computer and use it in GitHub Desktop.
Headless ChromeDriver with selenium
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
from selenium.webdriver.chrome.options import Options | |
opts = Options() | |
opts.add_argument("headless") | |
# opts.add_argument('no-sandbox') | |
opts.add_argument('window-size=1200x600') | |
opts.add_argument('disable-gpu') | |
opts.add_argument( | |
"user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36") | |
driver = webdriver.Chrome(chrome_options=opts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment