Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # extract the related items carousel's first page
- carousel = self.product_page.find("div", {"class": "a-carousel-viewport"})
- related_items = carousel.find_all("li")
- related_item_asins = [item.find("div")['data-asin'] for item in related_items]
- # of course, we need to get item links
- related_item_links = []
- for asin in related_item_asins:
- link = "www.amazon.com/dp/" + asin
- related_item_links.append(link)
Advertisement
Add Comment
Please, Sign In to add comment