Last active
May 13, 2017 15:16
-
-
Save odra/6d8071bdbea8b2e7197113e703126501 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
rss_url = 'http://www.feedforall.com/sample.xml' | |
document = etree.parse(rss_url) | |
items = document.xpath('/rss/channel/item') | |
for item in items: | |
title = item.xpath('title')[0].text | |
link = item.xpath('link')[0].text | |
description = item.xpath('description')[0].text | |
print('Title: %s\nLink: \%s\nDescription: \n%s' % (title, link, description)) | |
print('---') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment