Last active
August 29, 2015 14:21
-
-
Save tomkap/435090ad612a4ba6a330 to your computer and use it in GitHub Desktop.
I feel pretty, oh so pretty, I feel pretty and witty and gay...
This file contains 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
#!/usr/bin/env python | |
from xml.dom import minidom | |
from urllib import urlopen | |
site = 'http://www.nafpaktia-weather.gr/tmp/database.xml' | |
site_data = urlopen(site).read() | |
xmldoc = minidom.parseString(site_data) | |
tags = ['city', 'date', 'time', 'temp']; | |
for tag in tags: | |
value = xmldoc.getElementsByTagName(tag) | |
print('%s => %s') % (tag.upper(), value[0].firstChild.nodeValue) |
Author
tomkap
commented
May 24, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment