即使我已经安装并导入了BeautifulSoup模块,也无法解析rss链接

时间:2016-12-27 02:18:39

标签: python parsing rss

我每次都会产生错误

from bs4 import BeautifulSoup
import urllib.request

req=urllib.request.urlopen('https://www.cnn.com/politics?rss=1')
xml=BeautifulSoup(req,'xml')

for item in xml.findAll('link'):
    print(item)
  

追踪(最近一次呼叫最后一次):

Traceback (most recent call last):
 File "C:/Users/Pentazoid/Desktop/Become a professional python programmer/Section 2 web python programming/parsing_xml-46.py", line 1, in <module>
from bs4 import BeautifulSoup
ImportError: No module named 'bs4'

我在Windows命令提示符下安装了&gt; pip install beautifulsoup4但我仍然生成错误

0 个答案:

没有答案