爬虫报错:Do you need to install a parser library?

利用爬虫爬取安居客租房数据时遇到这个问题,经查阅解决方式如下:

将soup = BeautifulSoup(r.text, 'lxml')修改成如下形式即可:

soup = BeautifulSoup(r.text, 'html.parser')

猜你喜欢

转载自blog.csdn.net/qq_41996090/article/details/82313842