http://www.perlmonks.org?node_id=406134

waiterm has asked for the wisdom of the Perl Monks concerning the following question:

Here's an easy one for someone, i'm trying to get the response and source from this url using the get() method.

http://www.sweetcombe-ch.co.uk/aspbooking/avail.asp?Propref=201Classref=201

The source is being returned but minus the pricing and availability table. Why is this and how can I get around it?
  • Comment on Javascript interfering with get() method

Replies are listed 'Best First'.
Re: Javascript interfering with get() method
by waiterm (Acolyte) on Nov 08, 2004 at 18:00 UTC
    Worked around the problem using ::
    $URL = "http://www.sweetcombe-ch.co.uk/aspbooking/avail.asp?Propre +f=".$AGENTid."&Classref=".$AGENTid." LOCAL&"; $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "c:/tmp/lib/lwpcookies. +txt", autosave => 1)); $ua->agent("$0/0.1 " . $ua->agent); $ua->agent("Mozilla/8.0"); # pretend we are very capable browser $req = HTTP::Request->new(GET => $URL); $req->header('Accept' => 'text/html'); # send request $res = $ua->request($req); # check the outcome if ($res->is_success) { print $res->content; } else { print "Error: " . $res->status_line . "\n"; }