Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from bs4 import BeautifulSoup
- driver = webdriver.Chrome('/Users/kenny/Dropbox/Python/Web Scrapping/Others/chromedriver')
- driver.get('https://www.ebay.com/sch/i.html?_from=R40&_nkw=watches&_sacat=0&_pgn=1')
- soup = BeautifulSoup(driver.page_source, 'lxml')
- driver.maximize_window()
- for link in soup.find_all('a', href=True):
- if 'itm' in link['href']:
- print(link['href'])
- driver.execute_script("window.open(link['href'])") # Unable to open new tab of each watch to scrape each listing.
- driver.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement