- 258
- 40
При парсинге страницы мне выдаёт пустой список, но код 0. Помогите решить проблему.
Python:
import requests
from bs4 import BeautifulSoup
HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
}
books = []
book = input("Send book name: ")
url = 'https://bookfinder.com.ua/search/'+book+'/all/relevance/1'
content = requests.get(url, headers=HEADERS)
soup = BeautifulSoup(content.text, 'html.parser')
ausers = soup.find_all('li', class_='itemscope')
print(ausers)