Enabling Redirects

Enabling Redirects

am 20.11.2005 22:03:33 von Bret

Hi everyone,

I've got a couple of simple scripts that attempt to log into ebay and my Yahoo email
account. When I try to login, both scripts return a page that states that I have not
enabled my browser to allow automatic redirects. From everything I have read
when I use WWW::Mechanize, redirection is automatic. In the event of a POST I
need to add that to the list of allowed redirects and I have done so with the following
piece of code:

push @{$mech->requests_redirectable}, 'POST';

I do that before I try to $mech->get for any URL. Unfortunately that statement
doesn't seem to help. Looks like I am missing something very simple...at least I
hope so. Can anyone provide some insight into my problem and please provide
some sample code that can get more past this problem? Thanks in advance.

Re: Enabling Redirects

am 23.11.2005 23:05:03 von philippe.bruhat

Le dimanche 20 novembre 2005 =E0 16:03, Bret Swedeen =E9crivait:
>=20
> I do that before I try to $mech->get for any URL. Unfortunately that s=
tatement=20
> doesn't seem to help. Looks like I am missing something very simple...=
at least I=20
> hope so. Can anyone provide some insight into my problem and please pr=
ovide=20
> some sample code that can get more past this problem? Thanks in advanc=
e.

Are you sure the redirects are done with 3xx answers? It's also possible
that some JavaScript is modifying the document.location... In this case,
you'll have to emulate the redirection yourself.

--=20
Philippe "BooK" Bruhat

You can always buy another house but you cannot put a price on a home.
(Moral from Groo The Wanderer #63 (Ep=
ic))