在mechanize我们可以这样设置代理:
br = mechanize.Browser()
br.set_proxies({"http": "joe:password@myproxy.example.com:3128",
"ftp": "proxy.example.com",})
我们如何为 zope.testbrowser 做同样的事情? ?
非常感谢!
最佳答案
zope.testbrowser
是 mechanize 的包装器,您可以通过 mech_browser
属性访问包装的 mechanize 浏览器:
browser.mech_browser.set_proxies(dict(
http="joe:password@myproxy.example.com:3128",
ftp="proxy.example.com",
))
未测试,但以上应该有效。
关于python - zope.testbrowser 的代理设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6595035/