首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

beautifulsoup的有关问题

2013-04-09 
beautifulsoup的问题from bs4 import BeautifulSouphtml_srcurllib.urlopen(http://bj.meituan.com/).r

beautifulsoup的问题
from bs4 import BeautifulSoup
html_src=urllib.urlopen('http://bj.meituan.com/').read()
soup = BeautifulSoup(''.join(html_src))
soup.findall('div')

报错TypeError: 'NoneType' object is not callable
[解决办法]
soup = BeautifulSoup(''.join(html_src)) -> soup = BeautifulSoup(html_src)
soup.findall('div') -> soup.find_all('div')

热点排行