Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Javascript interfering with get() method

by waiterm (Acolyte)
on Nov 08, 2004 at 17:31 UTC ( #406134=perlquestion: print w/replies, xml ) Need Help??

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"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2022-08-15 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?