Answer the question
In order to leave comments, you need to log in
How to fix AttributeError: 'NoneType' object has no attribute 'find_all'?
Googled for a long time, but I still can't figure out what's wrong?
Gives: AttributeError: 'NoneType' object has no attribute 'find_all'
As I understand it, it does not find the required block, but how can I fix it?
I'm trying to parse a username from a page in VK
import requests;from bs4 import BeautifulSoup
link = input("")
responce = requests.get(link).text
soup = BeautifulSoup(responce, 'lxml')
block = soup.find('div', id = "page_info_wrap")
check_nikname = block.find_all('h1')[0].text
print(check_nikname)
Answer the question
In order to leave comments, you need to log in
import requests;from bs4 import BeautifulSoup
In my homeland, for this they are shot on the spot
responce = requests.get(link).text
soup = BeautifulSoup(responce, 'lxml')
block = soup.find('div', id = "page_info_wrap")
block = soup.find('div', attrs={"id":"page_info_wrap"}
check_nikname = block.find_all('h1')[0].text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question