use strict; use LWP::UserAgent; use URI::URL; use HTTP::Cookies; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 (.NET CLR 3.5.30729)"); my $cookie_jar = HTTP::Cookies->new(file=>$0."_cookie.txt",autosave => 1,); $ua->cookie_jar($cookie_jar); my $req=HTTP::Request->new(POST=>"https://www.dccourts.gov/cco/maincase.jsf"); $req->header("Content-Type"=> "application/x-www-form-urlencoded"); $req->header("Cookie"=>"JSESSIONID=9kpdNJ7dLQRc62Bsj3mTGsPNRnsvKyvL2DDJtLPgLhXpD9nwGSWm!-462614910"); $req->content("appData%3Asearchform=appData%3Asearchform&appData%3Asearchform%3AsearchPanelCollapsedState=false&appData%3Asearchform%3Ajspsearchpage%3AlastName=&appData%3Asearchform%3Ajspsearchpage%3AcompanyName=&appData%3Asearchform%3Ajspsearchpage%3AfirstName=&appData%3Asearchform%3Ajspsearchpage%3Aj_id_id14pc4=2011&appData%3Asearchform%3Ajspsearchpage%3AselectCaseType=CF2&appData%3Asearchform%3Ajspsearchpage%3Aj_id_id18pc4=003817&appData%3Asearchform%3Ajspsearchpage%3AnameAttributesPanelCollapsedState=true&appData%3Asearchform%3Ajspsearchpage%3AsubmitSearch.x=43&appData%3Asearchform%3Ajspsearchpage%3AsubmitSearch.y=12&javax.faces.ViewState=j_id1%3Aj_id3"); my $res=$ua->request($req); $cookie_jar->extract_cookies($res); $cookie_jar->save(); $cookie_jar->add_cookie_header($req); my $code=$res->code(); print "code:$code\n"; my $cont=$res->content(); open(postcontent,">>postcontent.html"); print postcontent $cont;