哈里森Python网页编程坚持抓取RSS源(3.4.2)

时间:2016-11-04 12:08:57

标签: python beautifulsoup rss lxml

我正在使用'Harrison Python Web Programming'学习Python课程,并且一直坚持使用'Scraping RSS feeds(3.4.2)'部分。

当我安装BeautifulSoup4时,它似乎安装得很好,但是当我执行代码时遇到了这个错误:

Traceback (most recent call last): File "C:/Users/Owen/Desktop/Owen/Electronics/Code/Python Web Programming XML.py", line 6, in <module> xml= BeautifulSoup(req, 'xml') File "C:\Users\Owen\AppData\Local\Programs\Python\Python35-32\lib\site-packages\bs4\__init__.py", line 165, in __init__ % ",".join(features)) bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

我在网上浏览了一下,并且被告知我需要安装lxml。但是当我这样做时,我遇到了这个错误:

error: Unable to find vcvarsall.bat

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

您可能正在看"Error: Unable to find vcvarsall.bat",因为pip假设您安装了MS Visual C ++编译器。 (如果我没有弄错的话,pip也假设你神奇地拥有正确版本的编译器。)

Futher reading

使用预编译的轮子通常会起作用。但是,每lxml:

  

如果您未能通过签名在MS Windows系统上构建lxml   我们发布的测试源,考虑使用二进制构建   来自PyPI或Christoph Gohlke的unofficial Windows binaries   慷慨地提供。