2012-04-26 52 views

回答

5

您可以使用hostip.info API的可視化部分。例如:

http://api.hostip.info/get_html.php?ip=64.233.160.0 

因此,使用urllib2 Python代碼是:

import urllib2 
f = urllib2.urlopen("http://api.hostip.info/get_html.php?ip=64.233.160.0") 
data = f.read() 
f.close() 

然後檢索數據從返回的結果。

如果您需要的經度和緯度,使用position=true標誌:

http://api.hostip.info/get_html.php?ip=64.233.160.0&position=true 
+1

Pymaps(Google Maps API的包裝)看起來是您創建實際地圖的解決方案。 http://code.google.com/p/pymaps/wiki/PymapsHowto – Jordonias 2012-04-26 23:42:50

+0

非常酷!謝謝! – 2012-04-27 18:18:22