【问题标题】:Python geocoder library: How to set proxy IP?Python地理编码器库:如何设置代理IP?
【发布时间】:2017-11-01 07:30:58
【问题描述】:

我使用 Python geocoder 库来访问坐标。我找不到为批量访问设置代理地址的方法。

【问题讨论】:

  • 您在问题中说的是“批量访问”,您能否更清楚地解释一下? ?可以设置代理地址,但不能批量访问?

标签: python python-3.x google-geocoder


【解决方案1】:

来自geocoder docs

>>> import geocoder
>>> proxies = {'http':'http://108.165.33.12:3128'}
>>> g = geocoder.google('New York City', proxies=proxies)
>>> g.json
...

geocoder 使用 requests,因此请参阅此处了解更多信息:

http://docs.python-requests.org/en/master/user/advanced/#proxies

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 2015-05-05
    相关资源
    最近更新 更多