BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], lxml) 解决未设置默认解析器的错误
生活随笔
收集整理的這篇文章主要介紹了
BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], lxml) 解决未设置默认解析器的错误
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在看時,敲了一些代碼,其中報了一個錯誤為
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')即可
總結
以上是生活随笔為你收集整理的BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], lxml) 解决未设置默认解析器的错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CSDNmarkdown编辑器直接写代码
- 下一篇: urllib2.HTTPError: H