【发布时间】:2021-06-07 22:22:57
【问题描述】:
我在尝试抓取网络数据时出错,错误消息显示
标签信息:“NoneType”对象没有“文本”属性
try:
label_info = soup.find('div', {'class': 'h-bg-white h-margin-a-default'})
if debug: print('Label info:',label_info.text)
if debug: print('')
except Exception as e:
label_info = ''
if debug: print("Label info:", e)
pass
谁能指导我为什么这不起作用?
【问题讨论】:
标签: python beautifulsoup web-crawler