Answer the question
In order to leave comments, you need to log in
Beautifulsoup returns None, what's the point?
I could not find the answer to the simplest question: if BS works without errors and as a result of parsing returns None, does this mean that there is no such element?
ps I'm trying to parse the VK friends search page
Answer the question
In order to leave comments, you need to log in
The documentation states that if find can't find anything, it returns None. www.crummy.com/software/BeautifulSoup/bs4/doc/#find
def get_html(url):
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
response = urllib.request.urlopen(req)
return response.read()
openfile= open('./files/nadym1.3.html','w',encoding='utf-8')
def parse(html):
soup = BeautifulSoup(html,"lxml")
table = soup.find('table ', class_='fl_r')
news = []
#print(link)
print(table)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question