Hi monks,
I'm trying to retrieve this web page
http://www.GIDEONonline.net/loginx.php?user=metalib
with the LWP::UserAgent. The code goes like this:
#!/usr/bin/perl use strict; use LWP::UserAgent; { my $ua = new LWP::UserAgent(); my $search_address = "http://www.GIDEONonline.net/loginx.php?user= +metalib"; #creating the request object my $req = new HTTP::Request ('POST', $search_address); #sending the request my $res = $ua->request($req); if (!($res->is_success)){ warn "Warning:".$res->message."\n"; } my $response = $res->headers_as_string(); my $response .= $res->content(); print "$response\n"; }
The response page is as so:
<HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript" SRC="js_lib/browser_check.js"></SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function goThere() { if ( (is_nav && (is_major >= 6)) || (is_ie && (is_majo +r >=5)) ) { document.location.href = "/authx.php?user=meta +lib&browser_ok=" + 1; } else { document.location.href = "/authx.php?user=meta +lib&browser_ok=" + 0; } } </SCRIPT> </HEAD> <NOSCRIPT> <BR> <CENTER><B>Javascript must be turned on to access Gideon Onlin +e.</B></CENTER> </NOSCRIPT> <BODY BGCOLOR="#FFFFFF" onLoad="goThere()"> </BODY> </HTML>
As far as I know, Javascript is not turned off (I retrieve similar pages that use javascript).
The page that I should recieve is Gideon Online's homepage. Because I have IP authentication I might expect problems with authentication on the server (although I have not experienced such problems before), but that doesn't explain the javascript being turned off. Does anybody have any ideas to what might be the reason this isn't working?
Thanks,
Guy Naamati

2006-07-09 Retitled by Corion, as per Monastery guidelines
Original title: 'javascript'


In reply to Handling Javascript with LWP::UserAgent by mrguy123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.