Im trying to retrieve the product names, weight and price in a list from the following site.
https://www.licious.in/seafood
my code to find the products list :
import requests
from bs4 import BeautifulSoup
URL = 'https://www.licious.in/seafood'
r = requests.get(URL)
soup = BeautifulSoup(r.content, 'lxml')
productlist = soup.find_all('div', class_="card")
productlinks = []
for card in productlist:
for link in card.find_all('a', href=True):
print(link['href'])
Can I use css selector for the product prices and product weight ?
I see several issues here:
soup.find_all("div", {"class": "product_image"})areimgelements, notdivimg1object received byitem.find("img")is not printable.This should work better: