Created
April 12, 2020 13:36
-
-
Save prince-mishra/aac831408224f15c59917614eef4f6fb to your computer and use it in GitHub Desktop.
run chrome in pyvirtualdisplay
This file contains hidden or 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 pyvirtualdisplay import Display | |
| from selenium import webdriver | |
| display = Display(visible=0, size=(800, 600)) | |
| display.start() | |
| # now Chrome will run in a virtual display. | |
| # you will not see the browser. | |
| browser = webdriver.Chrome() | |
| browser.get('http://www.google.com') | |
| print browser.title | |
| browser.quit() | |
| display.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment