in reply to Re^3: What parameters should I send?
in thread What parameters should I send?

Hello,

I rewrote my Perl script as follow:
#!/usr/bin/perl -w use LWP::UserAgent; my $ua = LWP::UserAgent->new; # Create a request my $response = $ua->post('http://www.sanmateocountytaxcollector.org/SM +CWPS/SearchParcels',{parcelNumber=>'048022230',searchType=>'parcel',l +istFirst=>'S',bkList=>'SS',addressTypeDsp=>'',addressType=>'',actionT +ype=>'search',nextPage=>'. 2Fpages 2FparcelList.jsp',parcel1=>'048',p +arcel2=>'022',parcel3=>'230'}); my $content = $response->content; print $content;
but it said
<h1>The page cannot be found</h1> The page you are looking for might have been removed, had its name cha +nged, or is temporarily unavailable.

when I ran it. What did I do wrong?

Replies are listed 'Best First'.
Re^5: What parameters should I send?
by moritz (Cardinal) on Dec 07, 2010 at 08:24 UTC
    nextPage=>'. 2Fpages 2FparcelList.jsp'

    That doesn't look right. It seems you used an encoded string, and passed it to $ua->post, which will encode it again.

    You can compare the headers your script sends to those that your browser sends, and look for differences.

    Also please try to learn about the subject that you're working on (here: HTTP, form submission) and develop some ideas on your own - I won't do your debugging and development forever.

      ok, one last question here, how do I view the header that my script sent? can I use the LiveHttpTool for that?
      Thanks.
        how do I view the header that my script sent?

        Either you find some debugging options in LWP::UserAgent, or you use a packet sniffer like wireshark, or you use a proxy that provides you with the debugging information.

Re^5: What parameters should I send?
by Corion (Patriarch) on Dec 07, 2010 at 08:24 UTC

    This is an error that your webserver sends you. It tells you that you entered the wrong URL.

    I recommend first getting your script to work from the command line.

    After you are certain that your script works from the command line, getting it to work within the webserver is then a matter of proper webserver configuration and looking at the webserver error log for the errors the webserver wants you to know about.