geopy - geopy.exc.GeocoderInsufficientPrivileges:HTTP 错误 403:禁止
问题描述
我试图使用 geopy 来获取纬度/经度,但它会引发 http 403 禁止错误。
from geopy.geocoders import Nominatim
geolocator = Nominatim()
addr = '350 5th Ave, New York, NY 10118'
location = geolocator.geocode(addr)
print location
过去几天一切正常。
raise ERROR_CODE_MAP[code](message)
geopy.exc.GeocoderInsufficientPrivileges: HTTP Error 403: Forbidden
解决方案
“GeocoderInsufficientPrivileges”错误 - 尝试使用“Photon”而不是“Nominatim”
from geopy.geocoders import Photon
geolocator = Photon(user_agent="measurements")
推荐阅读
- sql - SQL Server 每组添加行号
- bash - 如何在 bash 文件中使用 cat 和 EOF
- asp.net-mvc - 新网站的 msbuild 参数失败
- node.js - NodeJS getaddrinfo ENOTFOUND 未捕获
- tomcat - Tomcat 管理器 - 活动目录身份验证
- c# - Powershell not invoking method in a c# object
- linux - 如何找到“mongod”命令的位置?
- java - 键盘覆盖 Android Studio 中的 Edittext
- loops - 阻止 Rexx Do Loop 退出
- javascript - ES6 命名空间中的变量