开发者

Proxy setting for zope.testbrowser

In mechanize we can set proxy like this:

br = mechanize.Browser()
br.set_proxies({"http": "joe:password@myproxy.example.com:3开发者_StackOverflow社区128",
"ftp": "proxy.example.com",})

How do we do the same for zope.testbrowser?

Many thanks!


zope.testbrowser is a wrapper around mechanize, and you can reach the wrapped mechanize browser via the mech_browser attribute:

 browser.mech_browser.set_proxies(dict(
     http="joe:password@myproxy.example.com:3128",
     ftp="proxy.example.com",
 ))

Not tested, but the above should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜