Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: WWW::Mechanize or WWW::Selenium with server side redirect

by shmem (Chancellor)
on Jan 18, 2007 at 12:52 UTC ( #595244=note: print w/replies, xml ) Need Help??


in reply to WWW::Mechanize or WWW::Selenium with javascript redirect

It seems like the target (Bauer Versand) requires JavaScript for the content to be rendered properly. Without JavaScript, you just get the note:
Um Ihnen den Online-Einkauf so angenehm wie möglich zu machen, arbeiten wir mit der neuesten Technik.
Aus diesem Grund sind unsere Seiten für JavaScript-fähige Browser optimiert.
Leider unterstützt Ihr Browser zur Zeit nicht diese Funktion.
Damit auch Sie von den vielen Vorteilen profitieren können, müssen Sie in Ihren Einstellungen die Funktion "JavaScript/ActiveScripting" aktivieren.

In short, it tells you to activate JavaScript.

As for WWW::Mechanize to follow the redirect link, just say

my $mech = WWW::Mechanize->new(); my $response = $mech->get( $url ); $mech->follow_link( n => 1 ); # this is the one in the META tag my $html = $mech->content; ...

Since you use Firefox, you might want to look at JavaScript::SpiderMonkey to evaluate JavaScript. Some time ago, I wrote Re: Handling Javascript with LWP::UserAgent which might serve as an example.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2023-04-01 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?