Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How to get back the url of a page

by cormanaz (Deacon)
on May 16, 2007 at 16:29 UTC ( [id://615829]=note: print w/replies, xml ) Need Help??


in reply to How to get back the url of a page

Hmm this is more of a challenge than I expected.

You can get the response object from the mech request with $mech->{res}. HTTP::Response has a method $response->is_redirect that is supposed to tell you if it was a redirect, but when I tried that, i.e. $mech->{res}->is_redirect(), with a known redirect it returned null. Maybe some other monk knows why it doesn't work.

Anyway assuming the redirect is done with a refresh header, you can tell by getting $mech->{res}->header{'refresh'} I don't have a javascript direct to test it with, but I suspect it might not work for that

Cheers

Steve

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://615829]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found