Question

The Mechanize documentation mentions it briefly, but just sets it to False and nothing else. What are the parameters for and what does it actually do?

For example:

br = mechanize.Browser()
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
Was it helpful?

Solution

It's all about handling "refresh" meta tag behavior.

For example, if a page contains:

<meta http-equiv="refresh" content="5">

the browser would refresh the page every 5 seconds.

And if you want to change the behavior, you would use set_handle_refresh(). E.g. if you want to turn refreshing off:

br.set_handle_refresh(False)

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top