Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib.request import urlopen
- from xml.etree.ElementTree import parse
- # Descarga del archivo XML:
- texto_xml = urlopen('http://planet.python.org/rss20.xml')
- # Representación como documento XML:
- doc_xml = parse(texto_xml)
- # Recorrido del contenido del documento XML:
- for elemento in doc_xml.iterfind('channel/item'):
- print(elemento.findtext('title'))
- print(elemento.findtext('pubDate'))
- print(elemento.findtext('link'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement