Getting map location Python -
is there way computer geolocation (as in google maps "my location") python script? computer connected internet.
>>> import re,requests >>> raw = requests.get('http://www.geoiptool.com/').text >>> latlon = re.search("gpoint\(([^)]+)\)",raw).groups(0) >>> lat,lon = map(float,latlon[0].split(",")) >>> print "latitude:%s longitude:%s"%(lat,lon) latitude:-117.2455 longitude:46.7322
a couple of caveats ...
this not best method , should not done on , on again or might upset site owners
this uses ip lookups may not gps/wifi coordinates
Comments
Post a Comment