Proxies with Python 'Requests' module

后端 未结 10 805
傲寒
傲寒 2020-11-22 12:13

Just a short, simple one about the excellent Requests module for Python.

I can\'t seem to find in the documentation what the variable \'proxies\' should contain. Whe

10条回答
  •  隐瞒了意图╮
    2020-11-22 12:18

    The accepted answer was a good start for me, but I kept getting the following error:

    AssertionError: Not supported proxy scheme None
    

    Fix to this was to specify the http:// in the proxy url thus:

    http_proxy  = "http://194.62.145.248:8080"
    https_proxy  = "https://194.62.145.248:8080"
    ftp_proxy   = "10.10.1.10:3128"
    
    proxyDict = {
                  "http"  : http_proxy,
                  "https" : https_proxy,
                  "ftp"   : ftp_proxy
                }
    

    I'd be interested as to why the original works for some people but not me.

    Edit: I see the main answer is now updated to reflect this :)

提交回复
热议问题