Created
May 21, 2013 13:04
-
-
Save hellais/5619611 to your computer and use it in GitHub Desktop.
traceroute
This file contains hidden or 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
import sys | |
import requests | |
import lxml.html | |
ip = sys.argv[1] | |
r = requests.get("http://lg.ring.nlnog.net/traceroute/lg01/ipv4?q=" + ip) | |
root = lxml.html.fromstring(r.text) | |
result = root.cssselect("pre")[0] | |
print lxml.html.fromstring(lxml.html.tostring(result).replace("<br>", "\n")).text_content() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment