However, when I run this program, instead of getting the search results, I get the search page. Usually when this happens it is because of a cookie, but I couldn't find any cookies in this site. Does anybody know what the problem might be, and how I can solve it by retrieving the search results page?#!/exlibris/metalib/m4_b/product/bin/perl use strict; use LWP::UserAgent; { my $ua = new LWP::UserAgent(); my $search_address = "http://www.stat-usa.gov/nct_all.nsf/2d58b7a 34bbaa3838525703f004f804e?"; my $post = 'qAllWords=cats&qAnyWords=&qNoWords=&PostedSince=01%2F0 +1%2F2003&webcat_select=All&databases=ATL&databases=AGWORLD&databases= +MRD_CCG&databases=DLA&databases=CBD&databases=MRD_ISA&databases=MRD_I +MI&databases=MISCFILES&databases=MRD_ALL&databases=MRD_MDB&databases= +NED&databases=PUB&databases=ONLINE&databases=TOP&databases=ETO_DE&dat +abases=ETO_OF&configserver=CN%3Dstatweb01%2FOU%3Dwebserv%2FOU%3Dstate +sa%2FO%3Dstatdoc&configpath=nct_config5.nsf&webcategories=All&header= +&footer=&disp_header=&disp_footer=&saveoptions=0&query=AND+%28%5BdUpd +ate%5D+%3E+01%2F01%2F2003%29'; #creating the request object my $header = new HTTP::Headers(); my $req = new HTTP::Request ('POST', $search_address, $header, $po st); #sending the request my $res = $ua->request($req); if (!($res->is_success)){ warn "Warning:".$res->message."\n"; } print $res->as_string."\n"; }
In reply to Retrieving web pages with the LWP::UserAgent by mrguy123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |