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

I downloaded LiveHttpHeader as you said and ran it. Here is the result that I got but am unable to determine the exact line that was sent, could you help me out please.
http://www.sanmateocountytaxcollector.org/SMCWPS/SearchParcels POST /SMCWPS/SearchParcels HTTP/1.1 Host: www.sanmateocountytaxcollector.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11) Gecko +/20101028 CentOS/3.6-2.el5.centos Firefox/3.6.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0. +8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://www.sanmateocountytaxcollector.org/SMCWPS/pages/secure +Search.jsp Cookie: JSESSIONID=0000hccwV8X_iqYt4J9YpcxAwwC:-1 Content-Type: application/x-www-form-urlencoded Content-Length: 181 parcelNumber=048022230&searchType=parcel&listFirst=S&bkList=SS&address +TypeDsp=&addressType=&actionType=search&nextPage=.%2Fpages%2FparcelLi +st.jsp&parcel1=048&parcel2=022&parcel3=230

Replies are listed 'Best First'.
Re^3: What parameters should I send?
by moritz (Cardinal) on Dec 07, 2010 at 07:13 UTC
    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.

      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.

        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.