Skip to content

Instantly share code, notes, and snippets.

@kimberlythegeek
Created July 13, 2018 16:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kimberlythegeek/4d555535a72eb1458dafbd2b1838a201 to your computer and use it in GitHub Desktop.
Save kimberlythegeek/4d555535a72eb1458dafbd2b1838a201 to your computer and use it in GitHub Desktop.
driver = webdriver.Firefox()
driver.get('https://pypi.org')
with driver.context('chrome'):
driver.find_element_by_css_selector('image#pageActionButton').click()
driver.find_element_by_css_selector('#pageAction-panel-screenshots').click()
with driver.context(driver.CONTEXT_CONTENT):
sleep(2)
onboarding = driver.find_element_by_id('firefox-screenshots-onboarding-iframe')
driver.switch_to.frame(onboarding)
driver.find_element_by_id('skip').click()
sleep(2)
driver.switch_to.default_content()
sleep(1)
el = driver.find_element_by_class_name('statistics-bar')
action = webdriver.ActionChains(driver).move_to_element(el).click(el)
action.perform()
sleep(2)
frame = driver.find_element_by_id('firefox-screenshots-selection-iframe')
driver.switch_to.frame(frame)
sleep(2)
driver.find_element_by_class_name('highlight-button-save').click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment