开发者

how do i get python's mechanize to stop following meta refresh redirects?

开发者 https://www.devze.com 2023-01-12 15:38 出处:网络
I have a script which gets a webpage with a meta refresh. I need to parse the retrieved page but mechanize seems to follow the redirect. How do I get it to stop foll开发者_运维知识库owing it?You can s

I have a script which gets a webpage with a meta refresh. I need to parse the retrieved page but mechanize seems to follow the redirect. How do I get it to stop foll开发者_运维知识库owing it?


You can simply disable it

import mechanize
browser = mechanize.Browser()
browser.set_handle_refresh(False)
0

精彩评论

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