nkagolanu has asked for the wisdom of the Perl Monks concerning the following question:
The way the dtcc site is that there is an agree/decline form and it displays the data upon clicking the agree button. I want to extract the data and parse it but my problem is that the script is extracting the agree/decline page but not the data page. Is there a way for me to automate clicking on agree button so that I can extract the data on the second page.use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); $ua->proxy('http', 'my proxy'); # Create a request my $req = HTTP::Request->new(GET => 'http://dtcc.com/products/derivs +erv/data_table_iv.php'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting data from a website.
by moritz (Cardinal) on Jan 06, 2011 at 21:16 UTC | |
|
Re: Extracting data from a website.
by oko1 (Deacon) on Jan 07, 2011 at 00:14 UTC |