November 2017
Intermediate to advanced
226 pages
5h 59m
English
Here is how we can parse XML data with XML module:
from urllib.request import urlopen from xml.etree.ElementTree import parse
url = urlopen('http://feeds.feedburner.com/TechCrunch/Google')
xmldoc = parse(url)
for item in xmldoc.iterfind('channel/item'): title = item.findtext('title') desc = item.findtext('description') date = item.findtext('pubDate') link = item.findtext('link') print(title) print(desc) print(date) ...Read now
Unlock full access