使用代理后的herepy包进行地理编码

2024-09-28 12:14:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Python上的herepy包检索给定地址的地理坐标。当我在网络代理后面工作时,我已经用代理初始化了proxy环境变量。你知道吗

import os
import herepy 

os.environ['http_proxy'] = proxy 
os.environ['HTTP_PROXY'] = proxy

geocoderApi = herepy.GeocoderApi(HERE_AppID, HERE_AppCode)
response = geocoderApi.free_form('200 S Mathilda Sunnyvale CA')

但是,当我运行代码时,我得到了SSLError。有人知道哪里出了问题吗?你知道吗

SSLError: HTTPSConnectionPool(host='geocoder.cit.api.here.com', port=443): Max retries exceeded with url: /6.2/geocode.json?searchtext=200+S+Mathilda+Sunnyvale+CA&app_id=xxxxxxxxxx&app_code=xxxxxxxxxxxxCaused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

Tags: importapp代理hereos地址environcertificate

热门问题