что не так в моем коде
import requests
from bs4 import BeautifulSoup
import csv
HOST = "https://www.parsemachine.com/"
URL = "https://www.parsemachine.com/sandbox/catalog/"
HEADERS = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"User_Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67"
}
def get_html(url, params=" "):
r = requests.get(url, headers=HEADERS, params=params)
return r
def get_contnt(html):
products = []
soup = BeautifulSoup(html, "html.parser")
items = soup.find_all("div", class_="card product-card")
for item in items:
products.append(
{
"title": item.find("div", class_="no-hover title").get_text(),
"info": item.find("div", class_="mb-1").get_text(),
"image": item.find("img", class_="product-img img-fluid").find("img").get("src"),
"product_link": item.find("div", class_="card product-card").find("a").get("href")
}
)
return products
html = get_html(URL)
print(get_contnt(html.text))