fix scrape for new website
This commit is contained in:
@ -28,18 +28,18 @@ def scrape_listing(url):
|
||||
soup = make_soup(url)
|
||||
|
||||
#print(soup.find("div", class_="vim x-item-title").span.text)
|
||||
#print(soup.find("span", id="prcIsum")["content"])
|
||||
#print(soup.find("img", id="icImg")["src"])
|
||||
#print(soup.find("span", itemprop="price")["content"])
|
||||
#print(soup.find("img", itemprop="image")["src"])
|
||||
|
||||
listing = {
|
||||
'title': soup.find("div", class_="vim x-item-title").span.text,
|
||||
'price': float(soup.find("span", id="prcIsum")["content"]),
|
||||
'image': soup.find("img", id="icImg")["src"],
|
||||
'price': float(soup.find("span", itemprop="price")["content"]),
|
||||
'image': soup.find("img", itemprop="image")["src"],
|
||||
'url' : url
|
||||
}
|
||||
return listing
|
||||
|
||||
if __name__ == "__main__":
|
||||
listing = scrape_listing("https://www.ebay.de/itm/165508291809")
|
||||
listing = scrape_listing("https://www.ebay.de/itm/162861653490")
|
||||
print(listing)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user