N
N
Nick Sl2022-01-16 15:19:17
Python
Nick Sl, 2022-01-16 15:19:17

BeautifulSoup output is not HTML, how can I fix it?

import requests
from bs4 import BeautifulSoup

url = ' https://www.avito.ru/samara/avtomobili?p=1&q=gazel... '
respons = requests.get(url)
item = BeautifulSoup(respons.text, "html .parser")
print(item)
all_links = item.findAll('a', class_='iva-item-titleStep-_CxvN')


Hello! You need to find class_='iva-item-titleStep-_CxvN' , but the output of item is not HTML, but a clear set of strings, which makes it impossible to search for parsing. 61e40b9a3e249583368108.png
how to fix? Tried changing the BS argument to 'lxml' but the result is the same.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2022-01-16
@nmkru

A piece from the script that lies in the page code. Scroll through the console.
Well, if you are looking for certain elements, then output them to the console, why the full html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question