m逆光生长

关注

ResultSet object has no attribute ‘text‘

m逆光生长

关注

阅读 83

2022-06-09

最近在学BeautifulSoup,我就尝试用这个来下载一本红楼梦/
原来是:

wenben=new_soup.find_all('div',{'class':'chapter_content'})
print(wenben.text)

就报错:ResultSet object has no attribute 'text’后面一大堆
解决:

for  wenben in new_soup.find_all('div',{'class':'chapter_content'}):
print(wenben.text)

然后就下载好了:
ResultSet object has no attribute ‘text‘_python


相关推荐

影子喵喵喵

'list' object has no attribute 'get'

影子喵喵喵 48 0 0

登高且赋

AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘parameters‘

登高且赋 189 0 0

蚁族的乐土

详解Process object has no attribute '_popen'

蚁族的乐土 17 0 0

一叶轻舟okok

AttributeError: 'str' object has no attribute 'decode'

一叶轻舟okok 117 0 0

静悠

AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

静悠 180 0 0

吴wuwu

AttributeError: ‘ImageData‘ object has no attribute ‘data‘

吴wuwu 247 0 0

钟罗敏

AttributeError: 'dict' object has no attribute 'iteritems'

钟罗敏 44 0 0

双井暮色

AttributeError: 'module' object has no attribute 'maketrans'

双井暮色 92 0 0

你带来了我的快乐

AttributeError: ‘NoneType‘ object has no attribute ‘get‘

你带来了我的快乐 187 0 0

律楷粑粑

AttributeError: ‘int‘ object has no attribute ‘items‘

律楷粑粑 99 0 0

精彩评论(0)

0 0 举报