Skip to content

Instantly share code, notes, and snippets.

@SamadiPour
Last active July 31, 2022 22:55
Show Gist options
  • Save SamadiPour/ed0a7ee425663f710e4f88a28a578d60 to your computer and use it in GitHub Desktop.
Save SamadiPour/ed0a7ee425663f710e4f88a28a578d60 to your computer and use it in GitHub Desktop.
Deepnote selenium example
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument("window-size=1920,1080")
options.add_argument("--enable-javascript")
options.add_argument(
'user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
)
driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.GOOGLE).install(), options=options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment