【发布时间】:2017-03-18 06:25:01
【问题描述】:
我正在学习“Harrison Python Web 编程”的 Python 课程,但被困在“抓取 RSS 提要 (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
谁能帮忙?
【问题讨论】:
-
lxml和beautifulsoup4都有轮子,但仍然出现相同的错误。你有什么建议? -
lxml 有一个“非官方”的轮子,你在用吗?检查 MS Windows 部分:lxml.de/installation.html
-
完美!谢谢 jinks,有谁知道官方为什么不工作?
标签: python beautifulsoup rss lxml