V
V
vovka_losira2019-09-01 16:53:53
Python
vovka_losira, 2019-09-01 16:53:53

Why might the parsed text not be displayed?

I'm trying to parse the list of series from the site https://myseries.ru/series?page=1

import requests
from bs4 import BeautifulSoup
url = 'https://myseries.ru/series?page=1'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
inf = soup.find('a', class_='series-link')

print(inf)

when executing print(inf) some kind of garbage happens ... half of the text of the variable is simply not visible.
But, when acting on a variable, the type is inf.text or str(inf), the text can be seen normally in the console.
I understand that this is due to the fact that '==$0' is written in the part of the html code that I parse.
<a class="series-link" href="/series/chernobyl"> ==$0
  "
                  Чернобыль/Chernobyl
                  "
</a>

How can you parse such details normally? How it works? Where can you read? What to google then?
Thanks in advance )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question