def wiglePrint(username, password, netid):
browser = mechanize.Browser()
browser.open('https://wigle.net/')
reqData = urllib.urlencode({'credential_0': username, 'credential_1': password})
browser.open('https://wigle.net/gps/gps/main/confirmquery', reqData)
params = {}
params['netid'] = netid
reqParams = urllib.urlencode(params)
resp = browser.open('https://api.wigle.net/api/v2/network/search?first=0&netid=' + netid).read()
data = json.loads(resp)
mapLat = 'N/A'
mapLon = 'N/A'
rLat = data['results'][0].get('trilat', None)
if rLat:
mapLat = rLat
rLon = ata['results'][0].get('trilong', None)
if rLon:
mapLon = rLon
print '[-] Lat: ' + mapLat + ', Lon: ' + mapLon
评论列表
文章目录