Pregunta

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)
¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top