in reply to CGI to Pull links off webpage fails on second run

Is the website keeping track of my program and blocking it from repeated visits somehow?

If you can hit this site twice in a row with your browser, then chances are good that they're doing one of several things:

Ah. You posted code. Good. Try adding   $ua->agent("Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); to pretend that your script is a real browser.

Replies are listed 'Best First'.
Re: Re: CGI to Pull links off webpage fails on second run
by cdherold (Monk) on Apr 10, 2003 at 21:32 UTC
    I have disabled images and selected the option to refuse cookies (and have done so) for this page. I am still able to access repeatedly through the browser.

    I assume my LWP is only supplying the default value for the browser since i do not yet know how to specify otherwise. Do you have easy access to the code to do that? If not I can go find out myself and test it.

    thanks for the feedback. update: just got the code. I will go try it.

      To set the useragent:
      $ua->agent("foo/0.42");
Re: Re: CGI to Pull links off webpage fails on second run
by cdherold (Monk) on Apr 10, 2003 at 21:48 UTC
    I just ran it with the

    $ua->agent("Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");

    It now completes (although not nearly as fast as when it completes after the program hasn't been run in a while) but it doesn't retrieve any links. Prints out "Links: " and that's it.

      It now completes ... but it doesn't retrieve any links.

      Time to print out what they are returning. Chances are it's some variant on

      <html><body>Gotcha!</body></html>