Created
October 23, 2019 07:04
-
-
Save nbhasker/93df4a2558f0f26a63174722ff8c1316 to your computer and use it in GitHub Desktop.
Python + Selenium Script to download pictures from a Yahoo group
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
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