views:

198

answers:

1

Hello, is there a way to add JavaScript support to mechanize so that it will handle simple redirection like "document.location.href="? TIA

A: 

To support that, you'd only need to extract the href parameter ( using a regex maybe ) and then do :


mech.get(href_param)

As far as I know mechanize supports relative URL's.

If javascript's a must, then I would suggest firewatir. It can automate firefox, and this way you get a free javascript interpreter.

Geo
but what if redirection is conditional?
roddik