关于BeautifulSoup的问题(网络爬虫;python;BeautifulSoup)
代码是这样的:fromurllibimporturlopenfrombs4importBeautifulSouphtml=urlopen("http://www.pyth...
代码是这样的:from urllib import urlopenfrom bs4 import BeautifulSouphtml = urlopen("http://www.pythonscraping.com/pages/warandpeace.html")bsObj = BeautifulSoup(html)nameList = bsObj.findAll("span", {"class":"green"})for name in nameList: print(name.get_text())但是运行后会出错,如图。求解
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询