Skip to content

Instantly share code, notes, and snippets.

@kanazux
Created December 26, 2013 12:45
Show Gist options
  • Save kanazux/8133431 to your computer and use it in GitHub Desktop.
Save kanazux/8133431 to your computer and use it in GitHub Desktop.
Return my ip by speedtest xml
#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-
# Created in: Thu 19/Dec/2013 hs 15:06
# Last Change: Thu 19/Dec/2013 hs 15:06
# Autor: -- kanazuchi --
from urllib2 import urlopen
from xml.dom import minidom as dom
url = dom.parseString(urlopen('http://www.speedtest.net/speedtest-config.php').read())
client = url.getElementsByTagName('client')
print(client[0].attributes['ip'].value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment