Sunday, 15 July 2012

python extract links from an RSS feed -



python extract links from an RSS feed -

i using url http://www.sec.gov/archives/edgar/monthly/xbrlrss-2012-02.xml , parsing feedparser-5.1.3 using command:

g = feedparser.parse('http://www.sec.gov/archives/edgar/monthly/xbrlrss-2012-02.xml')

if go url see there many zip files per link in list.

my objective find , extract links zip files.

by putting command: g['feed'] in python shell feed.

the webinar(slide 8) offers code purpose unable utilize.

an excerpt set post:

for item in feed.entries: print( item[ "summary" ], item[ "title" ], item[ "published" ] ) try: # identify zip file enclosure, if available enclosures = [ l l in item[ "links" ] if l[ "rel" ] == "enclosure" ]

how can it?

change name g feed , can utilize code.

python

No comments:

Post a Comment