User
User

Reputation: 24739

What does the set_handle_refresh() method on a Mechanize browser do?

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)

Upvotes: 3

Views: 1405

Answers (1)

alecxe
alecxe

Reputation: 474031

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.

Upvotes: 3

Related Questions