【问题标题】:set HTTPS proxy with mechanize (python) - possible?使用机械化(python)设置HTTPS代理 - 可能吗?
【发布时间】:2015-04-07 01:09:26
【问题描述】:

我阅读了文档,谷歌搜索,我唯一能找到的是:

Python mechanize doesn't work when HTTPS and Proxy Authentication required

这似乎表明这是不可能的。我宁愿不去挖掘另一个图书馆,有人知道这是否可能吗?

【问题讨论】:

  • this.?它是红宝石,但也许,您可以调整解决方案。
  • 我认为这是通用的http代理?我正在尝试 https

标签: python http proxy mechanize


【解决方案1】:

你可以像这样在mechanize中设置HTTPS代理。

import mechanize
url = 'https://www.hostname.com/'
br = mechanize.Browser()
br.set_proxies({"http":"username:passwd@X.X.X.X:port",
                "https":"username:passwd@X.X.X.X:port"})
br.set_handled_schemes(['http', 'https'])
br.open(url)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-01
    • 1970-01-01
    • 2012-11-10
    • 2012-08-05
    • 1970-01-01
    相关资源
    最近更新 更多