首页 > 代码库 > 伪装浏览器根据经纬度解析地理位置
伪装浏览器根据经纬度解析地理位置
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 作者:昨夜星辰 脚本作用:伪装浏览器根据经纬度解析地理位置 创建时间:2017-01-11 """ import re import requests lat = ‘23.0300000000‘ lng = ‘113.7500000000‘ url = ‘http://www.gpsspg.com/apis/maps/geo/‘ ‘?output=jsonp&lat=%s&lng=%s‘ ‘&type=0&callback=jQuery110208922237625713032_1484117544079&_=1484117544080‘ % (lat, lng) headers = { "Accept": "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01", "Accept-Encoding": "gzip, deflate, sdch", "Accept-Language": "zh-CN,zh;q=0.8", "Cache-Control": "no-cache", "Connection": "keep-alive", "Cookie": "ARRAffinity=1c4bb86219260370ca02426fc1018822e09cba1fb72ab3da662d6370f9142231;" "Hm_lvt_15b1a40a8d25f43208adae1c1e12a514=1484097427,1484117457;" "Hm_lpvt_15b1a40a8d25f43208adae1c1e12a514=1484117548;AJSTAT_ok_pages=5;AJSTAT_ok_times=2", "Host": "www.gpsspg.com", "Pragma": "no-cache", "Referer": "http", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)" "Chrome/55.0.2883.87 Safari/537.36", "X-Requested-With": "XMLHttpRequest", } text = requests.get(url, headers=headers).text print re.search(r‘"address":"(.*?)"‘, text).group(1)
伪装浏览器根据经纬度解析地理位置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。