0

Есть код

import lxml
import requests
import json
import csv

url = "https://pilomaterialov.net/catalog/"
r = requests.get(url)
src = r.text

soup = BeautifulSoup(src, "lxml")
all_prod = soup.find_all("div", class_="category-name")
for item in all_prod:
  item_title = item.text
  item_link = item.get("href")
  print(f"{item_title}: {item_link}")

Ошибки нет, но вместо ссылок None. Подскажите в чем ошибка?

                          Фанера            
: None
3
  • значит, ничего не находит. 24 апр 2023 в 12:58
  • 1
    item_link = item.a.get("href") 24 апр 2023 в 13:24
  • @Сергей Ш. Супер...спасибо, огромное!
    – Илья
    24 апр 2023 в 13:39

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.