开发者

transfer cookies from twill to zope

开发者 https://www.devze.com 2023-01-19 14:35 出处:网络
I\'m trying to figure out a way to transfer cookies from a Twill browser instance to a Zope browser instance. They both are built on Mechanize, so this should be possible.

I'm trying to figure out a way to transfer cookies from a Twill browser instance to a Zope browser instance. They both are built on Mechanize, so this should be possible.

I have tried:

zopeBrowser = zope.testbrowser.browser.Browser()
twillBrowser = twill.commands.get_browser()

twillBrowser.go("http://example.com/") #开发者_如何转开发 got some cookies
zopeBrowser.mech_browser._ua_handlers['_cookies'].cookiejar = \
    twillBrowser._browser._ua_handlers['_cookies'].cookiejar

But that doesn't seem to have worked.

Any ideas?

Thanks!

0

精彩评论

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

关注公众号