Skip to content

Instantly share code, notes, and snippets.

@josemariagarcia95
Last active April 5, 2020 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josemariagarcia95/ebfbed7a9ca71b76025c73d712c63c74 to your computer and use it in GitHub Desktop.
Save josemariagarcia95/ebfbed7a9ca71b76025c73d712c63c74 to your computer and use it in GitHub Desktop.
# Remove the upper bar, but it is not really necessary, it was just a test using execute_script
chrome_driver.execute_script(
"var a = arguments[0]; var b = arguments[1]; a.parentElement.removeChild(a); b.parentElement.removeChild(b)", header, header_inline)
# Spread "Year" drop-drown list to make the "Undated" category visible
for see_more_button in chrome_driver.find_elements_by_css_selector("button.show-more-button"):
chrome_driver.execute_script("arguments[0].click();", see_more_button)
# Click the "Undated" button (it has to be found like this since there is no id and the class name is not valid, '1000,' and it's not
# detected by others methods like find_element_by_class_name or find_element_by_css_selector)
more_photos_button = chrome_driver.find_element_by_xpath(
"//button[@class='1000']"
)
chrome_driver.execute_script("arguments[0].click();", more_photos_button)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment