Skip to content

Instantly share code, notes, and snippets.

@odra
Last active May 13, 2017 15:16
Show Gist options
  • Save odra/6d8071bdbea8b2e7197113e703126501 to your computer and use it in GitHub Desktop.
Save odra/6d8071bdbea8b2e7197113e703126501 to your computer and use it in GitHub Desktop.
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