Answers for "mechanize python XE #3"

0

mechanize python XE #3

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/login', reqData)
    params = {}
    params['netid'] = netid
    reqParams = urllib.urlencode(params)
    respURL = 'https://wigle.net/gps/gps/main/confirmquery/'
    resp = browser.open(respURL, reqParams).read()
    print str(resp)
    mapLat = 'N/A'
    mapLon = 'N/A'
    rLat = re.findall(search_lat, resp)
    if rLat:
        mapLat = rLat[0].split('&')[0].split('=')[1]
    rLon = re.findall(search_lon, resp)
    if rLon:
        mapLon = rLon[0].split
    print '[-] Lat: ' + mapLat + ', Lon: ' + mapLon

#打印网络信息
Posted by: Guest on September-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language