Home>

I'm collecting data from a site using BeautifulSoup and requests. I make a request, but I get only an HTML string without text. I have already tried dozens of ways, but still the data does not come out. I've attached the output and code below.

Please tell me how to solve the problem?

import requests
from bs4 import BeautifulSoup as BS
url= 'http://www.licey2perm.ru/'
r= requests.get(url)
html= BS(r.text, 'html.parser')
address= html.find('div', {'class': 'title', 'data-bind': "text: title"})
print(address)

Outputs:<div class="title" data-bind="text: title"></div>
And I have to give:<h3 class="title" data-bind="html: title">Schedule for 24.01.2022-28.01.2022</h3>

Why should it render

if you are asking for ? And 'data-bind' also has a different meaning.

GrAnd2022-01-19 19:39:14

because the data is loaded later! Use Selenium

Андрей Крузлик2022-01-19 19:39:14