python selenium scrape apps.upenn.edu
furas Feb 25th, 2020 (edited) 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import selenium.webdriver
- def scrape(last_name, first_name):
- url = 'https://directory.apps.upenn.edu/directory/jsp/fast.do'
- driver = selenium.webdriver.Firefox()
- inputs = driver.find_elements_by_tag_name('input')
- #for item in inputs:
- # print(item.get_attribute('name'))
- items = driver.find_elements_by_xpath('//tr[@class="lookupbody"]//a[@class="linkText"]')
- for item in items:
- # --- main ---
- scrape("Tomasco", "Lauretta")
- #scrape("Austin", "Westberg")
RAW Paste Data