speedparser icon indicating copy to clipboard operation
speedparser copied to clipboard

Not work with http://news.ycombinator.com/rss

Open luminousmen opened this issue 8 years ago • 1 comments

>>> import speedparser
>>> feed = "http://news.ycombinator.com/rss"
>>> speedparser.parse(feed)
{'bozo_tb': 'Traceback (most recent call last):\n  File "/home/kir/.virtualenvs/rss/lib/python3.5/site-packages/speedparser/speedparser.py", line 688, in parse\n    parser = SpeedParser(document, cleaner, unix_timestamp, encoding)\n  File "/home/kir/.virtualenvs/rss/lib/python3.5/site-packages/speedparser/speedparser.py", line 585, in __init__\n    self.tree = tree.getroottree()\nAttributeError: \'NoneType\' object has no attribute \'getroottree\'\n', 'bozo_exception': AttributeError("'NoneType' object has no attribute 'getroottree'",), 'bozo': 1, 'feed': {}, 'entries': []}

luminousmen avatar Oct 26 '17 20:10 luminousmen

It seems speedparser does not include feedparsers handling of URLs. You have to get the feed with something like:

import urllib2
feed=urllib2.urlopen('http://newsroom.co.nz/feed/rss')
speedparser.parse(feed.read())

foxylad avatar Aug 28 '18 02:08 foxylad