使用mechanize(python)设置HTTPS代理 - 可能吗?

时间:2015-04-07 01:09:27

标签: python http proxy mechanize

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

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

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

1 个答案:

答案 0 :(得分:0)

你可以像这样在机械化中设置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)
相关问题