Created
July 13, 2018 16:42
-
-
Save kimberlythegeek/4d555535a72eb1458dafbd2b1838a201 to your computer and use it in GitHub Desktop.
This file contains 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
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