Python feedparser出现未声明的名称空间错误

Python feedparser出现未声明的名称空间错误,python,python-2.7,feedparser,Python,Python 2.7,Feedparser,您好,我在使用Feedparser时遇到以下错误: 引发未声明的命名空间,'%s'未与命名空间关联% givenprefix feedparser.UndeclaredNamespace:“媒体”未关联 使用名称空间 我已设法将范围缩小到一个提要,这就是原因: 我正在编写一个web scraper,它使用Feedparser和BeautifulSoup从我感兴趣的各种rss提要中刮取新闻文章,我正在使用Python编写这篇文章 错误消息如下: feed = feedparser.parse(i

您好,我在使用Feedparser时遇到以下错误:

引发未声明的命名空间,'%s'未与命名空间关联% givenprefix feedparser.UndeclaredNamespace:“媒体”未关联 使用名称空间

我已设法将范围缩小到一个提要,这就是原因:

我正在编写一个web scraper,它使用Feedparser和BeautifulSoup从我感兴趣的各种rss提要中刮取新闻文章,我正在使用Python编写这篇文章

错误消息如下:

feed = feedparser.parse(in_feed)
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 4014, in parse
saxparser.parse(source)
File "/usr/lib/python2.7/dist-packages/drv_libxml2.py", line 208, in parse
eltName,eltQName,attributesNSImpl) 
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 1809, in startElementNS
raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix
feedparser.UndeclaredNamespace: 'media' is not associated with a namespace 

所有其他提要都可以。有人能给我一些建议吗?

我查看了Mashable提要,它的顶部有所有导入的名称空间:

<rss version='2.0' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:campaign='http://organizecampaign.com/' xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:mash='http://mashable.com/rss' xmlns:mashable='http://mashable.com/rss' xmlns:slash='http://purl.org/rss/1.0/modules/slash/' xmlns:sy='http://purl.org/rss/1.0/modules/syndication/' xmlns:wfw='http://wellformedweb.org/CommentAPI/'>

当抛出异常时,您正在执行什么代码?我正在运行'feed=feedparser.parse(in_feed)'where in_feed=我已经就这个问题联系了Mashable。
xmlns:media="http://search.yahoo.com/mrss/"