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

parcelNumber=048022230&searchType=parcel&listFirst=S&bkList=SS&addressTypeDsp=&addressType=&actionType=search&nextPage=.%2Fpages%2FparcelList.jsp&parcel1=048&parcel2=022&parcel3=230

That's the list of POST parameters and their values. If you replicate them, you should be fine.

Replies are listed 'Best First'.
Re^4: What parameters should I send?
by brian123 (Novice) on Dec 07, 2010 at 08:20 UTC
    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?
      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.

      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.