Skip to content

Instantly share code, notes, and snippets.

@presto8
Forked from nbhasker/GetYahooPics.py
Created November 16, 2019 21:50
Show Gist options
  • Save presto8/6862e3d9c4503cf4e390270027165588 to your computer and use it in GitHub Desktop.
Save presto8/6862e3d9c4503cf4e390270027165588 to your computer and use it in GitHub Desktop.
Python + Selenium Script to download pictures from a Yahoo group
from selenium import webdriver
import time
driver = webdriver.Chrome("drivers\chromedriver.exe")
driver.set_page_load_timeout(10)
driver.get("https://groups.yahoo.com/neo/groups/oresis_alumni/photos/photostream")
time.sleep(30)
n = 1
while 1:
print n
li_elem = driver.find_element_by_css_selector('li.position.loaded.active')
dl_elem = li_elem.find_element_by_xpath('.//*[@aria-label="Download"]')
driver.execute_script("arguments[0].click();", dl_elem)
time.sleep(4)
next_elem = driver.find_element_by_xpath('//*[@aria-label="Next"]')
driver.execute_script("arguments[0].click();", next_elem)
time.sleep(4)
n = n + 1
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment