Sparsil type links:
reference = "*"
I pass on them using requests:
r = get(reference)
I receive the answer of a valid type. Then parse the content on the subject of a div
'and with the class componentboxcontents
and write to the file:
soup = BeautifulSoup(r.content, "lxml") box = soup.find("div", {"class":"componentboxcontents"}) file2.write(str(box))
But in the file I see the following picture:
<p> </p> Ключ показывает, какие именно стрелки отходят из того места, где стоит буква, которую мы должны выбрать. В результате прочитывается слово КОМПЬЮТЕР.
The text is outside the p
tag and can not be further parsed (Moreover, in all p
tags), although it should look something like this:
<p> Ключ показывает, какие именно стрелки отходят из того места, где стоит буква, которую мы должны выбрать. В результате прочитывается слово КОМПЬЮТЕР. </p>
How to fix?