问题描述
希望使用 Python 实现更好的地理位置.
Hostip.info 是一个开源项目,其目标是构建/维护一个数据库将 IP 地址映射到城市.他们的关于页面解释了填充这个数据库所依赖的数据源.
使用 HostIP,有两种方法可以从 IP 地址获取位置数据:
他们还有一个精心设计且易于使用的 RESTFUL API:只需在 i***p=*** 之后传入您的 IP 地址在 GET 请求字符串中):
导入urllibresponse = urllib.urlopen('http://api.hostip.info/get_html.php?ip=12.215.42.19&position=true').read()打印(响应)其次,项目网站还提供完整的数据库供下载.p>
Looking to implement better geo-location with Python.
Hostip.info is an open-source project with the goal to build/maintain a database mapping IP addresses to cities. Their about page explains the data sources relied on to populate this database.
Using HostIP, there are two ways to get location data from an IP address:
They also have a well-designed and easy-to-use RESTFUL API: just pass in your ip address after the i***p=*** in the GET request string):
import urllib
response = urllib.urlopen('http://api.hostip.info/get_html.php?ip=12.215.42.19&position=true').read()
print(response)
Second, the Project Website also makes its complete database available for download.
这篇关于在给定 IP 地址的情况下,哪些 python 库可以告诉我大概的位置和时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)