Last active
January 9, 2021 01:17
-
-
Save felipemotabr/72ff70d98005dfa9d7742987fe4fa614 to your computer and use it in GitHub Desktop.
Selenium Webdriver with headless options
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 selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| import os | |
| options = Options() | |
| options.add_argument("--headless") | |
| options.add_argument("--window-size=1920,1080") | |
| driver = webdriver.Chrome(options=options) | |
| params = {'behavior': 'allow', 'downloadPath': os.getcwd()} | |
| driver.execute_cdp_cmd('Page.setDownloadBehavior', params) | |
| driver.get('https://github.com/felipemotabr/react-facebook-clone') | |
| driver.find_element_by_xpath("//summary[@class='btn btn-primary']").click() | |
| driver.find_element_by_xpath("//a[@data-open-app='link']").click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment