Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from bs4 import BeautifulSoup
- browser = webdriver.Chrome('/Users/kenny/MEGA/Python/chromedriver')
- browser.get('https://www.ebay.com/itm/Invicta-Mens-Watch-Pro-Diver-Quartz-Black-Dial-Dive-Quartz-Bracelet-8932OB/331897627367?epid=222453104&hash=item4d46a3e2e7:g:moYAAOSwvNhdE81c')
- bs = BeautifulSoup(browser.page_source, 'lxml')
- browser.maximize_window()
- title_selenium = browser.find_element_by_xpath('//*[@id="itemTitle"]').text
- title_BeautifulSoup = bs.find('h1', {'id': 'itemTitle'}).contents
- price_selenium = browser.find_element_by_xpath('//*[@id="prcIsum"]').text.strip().split()
- price_BeautifulSoup = bs.find("span", {"id": "prcIsum"}).text
- total_sold_selenium = browser.find_element_by_xpath('//*[@id="mainContent"]/form/div[1]/div[4]/div[2]/div/span[3]').text
- total_sold_price_BeautifulSoup = bs.find('span', {'class': 'vi-qtyS-hot-red'}).text
- print("title_selenium", ": ", title_selenium)
- print("title_BeautifulSoup", ": ", title_BeautifulSoup[1],"\n")
- print("price_selenium", ": ", price_selenium)
- print("price_BeautifulSoup", ": ", BeautifulSoup,"\n")
- print("total_sold_sel_version", ": ", total_sold_selenium)
- print("total_sold_bs_version", ": ", total_sold_price_BeautifulSoup,"\n")
- browser.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement