我阅读文档,谷歌搜索,我唯一能找到的是:
Python mechanize doesn't work when HTTPS and Proxy Authentication required
似乎表明这是不可能的。我宁愿不去挖掘另一个图书馆,有人知道这是否可能?
答案 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)