python BeautifulSoup解析器在windows和linux中的差异

在windows上正常跑起的python脚本爬取网页数据,部署到linux突然就挂掉了!!!

经过一系列的排查,终于找到原因

BeautifulSoup得背锅了!

(爬虫中用的是requests+BeautifulSoup来爬取数据)

差异点:

windows:

soup = BeautifulSoup(html, "lxml")

 

linux:

soup = BeautifulSoup(html, "html.parser")

 

posted @ 2020-04-08 18:00  天库  阅读(334)  评论(0)    收藏  举报