BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], "lxml") 解决未设置默认解析器的错误

来源:互联网 发布:场地租用费淘宝 编辑:程序博客网 时间:2024/05/22 02:05

在看时,敲了一些代码,其中报了一个错误为
BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], “lxml”)未设置默认解析器德的错误

`
html = urlopen(“http://en.wikipedia.org“+articleUrl)
bsObj = BeautifulSoup(html)

`

将代码中的 bsObj = BeautifulSoup(html)改为

bsObj = BeautifulSoup(html,'lxml')

即可

1 0
原创粉丝点击