Impossible to retreive Web page ???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yjulien
    New Member
    • Feb 2011
    • 43

    Impossible to retreive Web page ???

    Hi,

    I'm currently registered on several boating Forums. Since I travel a lot, I wrote a program to copy certain thread on a daily basis and store them on my server for later reading.

    For some reason, one of those forum let me browse it no problem but when I used my script, I get a "denied access type page". I contacted the Webmaster and he assured me that my IP was not banned... What can it be? Is there a bad exchange between the script and the Web Page?

    Here is the script that gets the Web page. It works before with other forums.



    Code:
    use LWP::UserAgent;
    
    my $URL = 'http://passionvoile.forumcanada.net';
    
    
    
    print "$path <br> Testing : $URL <br>";
    
    my $ua = LWP::UserAgent->new(
        agent => "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 GTB7.1",
    );
    
    my $response = $ua->get($URL, Referer => "http://google.com/search/");
    
    if (!$response->is_success) {
         print $response->status_line;     # imprime le code d'erreur si problème.
    }
    
    my $html = $response->decoded_content;
    
     print $html; # this is how I know the actual page as not been copy but an denied error page was given.
    
    $content = $html;
    
    open (DATABASE, ">$path/pages_web/elie-$pare_date.html");
    print DATABASE "$content";
    close (DATABASE);
    
    exit;
    Thanks you for your help.

    Yves
    Last edited by yjulien; Mar 8 '12, 02:22 AM. Reason: spelling
  • chorny
    Recognized Expert New Member
    • Jan 2008
    • 80

    #2
    Even if I comment out 'agent' string, I get correct page.

    Comment

    • yjulien
      New Member
      • Feb 2011
      • 43

      #3
      Hi Chrony,

      Did you try out with your regular browser first and then with the code ?

      Is my code OK? Should I do something else?

      Thanks,

      Yves

      Comment

      • chorny
        Recognized Expert New Member
        • Jan 2008
        • 80

        #4
        yes, with same result

        Comment

        • yjulien
          New Member
          • Feb 2011
          • 43

          #5
          That is completly strange!?!?!?! I tried this code on two different server with two very different IP and I still get the message that I've been banned, which make no sence at all.

          Comment

          Working...