Python Mechanize keeps giving me 'response_seek_wrapper' when I try to use .open

▼魔方 西西 提交于 2019-12-04 19:10:49

it's not an exception, is it?
nothing wrong is happening, you just got a return value, which is esentially a response object, equivalent to br.response().

see

>>> r = browser.open("http://google.com")
>>> r
<response_seek_wrapper at 0x9bb116c whose wrapped object = <closeable_response at 0x9bb426c whose fp = <socket._fileobject object at 0x9ba306c>>>
>>> r.info().headers
# see the response headers

vs

>>> browser.open("http://google.com")
>>> browser.response()
<response_seek_wrapper at 0x9c229cc whose wrapped object = <closeable_response at 0x9bb426c whose fp = <socket._fileobject object at 0x9ba306c>>>
>>> browser.response().info().headers
# see the response headers
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!