in reply to Use LWP::UserAgent to go to a password protected ASP page

Dear shiza and davidrw:

I am thrilled by such a quick response from you two. Both solutions are running fine. However, they did not solve the problem, i.e still could not return the link of ASP page. Any other suggestions?

Thanks in advance!

Puma_perl

  • Comment on Re: Use LWP::UserAgent to go to a password protected ASP page

Replies are listed 'Best First'.
Re^2: Use LWP::UserAgent to go to a password protected ASP page
by mifflin (Curate) on Aug 09, 2005 at 20:32 UTC
    You could put up a http proxy server using HTTP::Proxy. This would allow you to see all http headers (and the message if you wish) before they are sent.
    In IE6 change you LAN Settings to use the proxy. Add the host name and port you are using. If you use the example below you would use port 8080.
    use warnings; use strict; use Data::Dumper; use HTTP::Proxy; use HTTP::Proxy::HeaderFilter::simple; use IO::File; my $proxy = HTTP::Proxy->new(port => 8080); $proxy->host(undef); my $filter = HTTP::Proxy::HeaderFilter::simple->new(\&myfilter); $proxy->push_filter(request => $filter); $proxy->start(); sub myfilter { my ($this, $headers, $message) = @_; print '=' x 70, "\n"; print $headers->as_string(); STDOUT->flush(); }
    Using this proxy you can compare the http headers being send when you submit you page via a browser versus lwp useragent.
Re^2: Use LWP::UserAgent to go to a password protected ASP page
by tomazos (Deacon) on Aug 10, 2005 at 02:52 UTC
    Just use a packet sniffer.
    1. Download and install packet sniffer.
    2. Turn it on.
    3. Check the page successfully with Internet Explorer.
    4. Check the page unsuccessfully with the script.
    5. Turn off packet sniffer and inspect the two requests.

    The differences in the headers of the two HTTP request-responses will tell you what is going wrong.

    The one I use on a Windows client machine is called Smart Sniff.

    -Andrew.

    Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com
      Thanks for your tips Andrew! Where can I get Smart Sniff?

      Puma_perl