Answer the question
In order to leave comments, you need to log in
Can't parse the page?
Hello! It is necessary to parse the site, more precisely, the profiles of the people whom the site found.
It seems to be nothing complicated, I do it like this:
url = 'https://go.mail.ru/search_social?fr=main&frm=main&q=%D0%98%D0%B2%D0%B0%D0%BD%20%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2&src=go&sbmt=1626900599514&hasnavig=0'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
people=soup.find_all('a', {'class': 'Link-root NarrowCard-wrapper Link-hoverable Link-visitable'})
print ( people )
Answer the question
In order to leave comments, you need to log in
1. Check what kind of response your script receives from the site (stupidly write it to a file and look). Many sites are protected from such unfortunate parsers.
2. Even if the site is not specially protected, the information can be loaded by a script, i.e. the page does not contain it initially. In this case, you need to either reverse-engineer the script (find out what request it makes and try to reproduce), or use a script-driven browser like selenium.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question