在
for i in range(1, 160):
print(i)
url = 'https://bbs.hupu.com/bxj-postdate-' + str(i)
r=rq.get(url, headers=h)
r.encoding='utf8'
print(r.text)
soup=BeautifulSoup(r.text, 'lxml')
lis = soup.find(class_="show-list").find_all('li')
运行到i= 11时报错:
lis = soup.find(class_="show-list").find_all('li')
AttributeError: 'NoneType' object has no attribute 'find_all'
在
for i in range(1, 160):
print(i)
url = 'https://bbs.hupu.com/bxj-postdate-' + str(i)
r=rq.get(url, headers=h)
r.encoding='utf8'
print(r.text)
运行到i= 11时报错:
lis = soup.find(class_="show-list").find_all('li')
AttributeError: 'NoneType' object has no attribute 'find_all'