最近在学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)
然后就下载好了: