HaveF / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

UndeclaredNamespace error with feedparser #428

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I am running feed = feedparser.parse(in_feed)' where 
in_feed=feeds.mashable.com/Mashable

What is the expected output? What do you see instead?
It should not return an error as all other rss feeds from the opml file are 
working.

What version of the product are you using? On what operating system?
os: 14.04 LTS
Python: Python 2.7.6
Feedparser 5.1.3
Beautiful Soup 4.2.1
lxml 3.3.3

Please provide any additional information below:

Hello I am getting the following error when using Feedparser:

    raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix feedparser.UndeclaredNamespace: 'media' is not associated with a namespace

I have managed to narrow it down to one feed which is the cause:

    http://feeds.mashable.com/Mashable

I am writing a web scraper which uses Feedparser and Beautiful soup to scrape 
news articles from various rss feed that I am interested in, I am writing this 
using Python.

The error message is this:

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 

Original issue reported on code.google.com by omran.na...@googlemail.com on 3 Aug 2014 at 12:11