Skip to content

Instantly share code, notes, and snippets.

@felipemotabr
Last active January 9, 2021 01:17
Show Gist options
  • Select an option

  • Save felipemotabr/72ff70d98005dfa9d7742987fe4fa614 to your computer and use it in GitHub Desktop.

Select an option

Save felipemotabr/72ff70d98005dfa9d7742987fe4fa614 to your computer and use it in GitHub Desktop.
Selenium Webdriver with headless options
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