hhalpin has asked for the wisdom of the Perl Monks concerning the following question:
As explained in an earlier post, am trying to automate my usage of an on-line database using LWP. This is my first time using LWP, so if I say anything silly please have patience :)
I found the responses to my last post to be quite good, and now I have the following as code:
use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = new LWP::UserAgent; my $req = POST 'http://lsa.colorado.edu/cgi-bin/LSA-sentence.html', [ txt1 => 'I hate Jimmy. I love Jimmy.']; $content = $ua->request($req)->as_string; open(OUTPUT, ">>result.html"); print OUTPUT $content;
Which manages to retrieve the web-page LSA-sentence.html, but not the resulting web-page produced by the CGI ":http://lsa.colorado.edu/cgi-bin/LSA-sentence-x.html". I believe this is b/c the web-page features a "Submit" button am not pressing. I believe this is it in HTML from the web page:
How do I press those buttons, if that is needed, or is there some other way to get my precious resulting web-page? I assume it's in my request "hash" - but how? Once I get it - I assume it will be in content - I would like just to print it to a file for later processing.INPUT TYPE="submit" VALUE="Submit Texts"> INPUT TYPE="reset" VALUE=" Reset to Defaults ">
Thanks!
Harry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem retrieving Web-page using LWP - help!
by chromatic (Archbishop) on Nov 30, 2000 at 22:40 UTC | |
|
Re: Problem retrieving Web-page using LWP - help!
by swiftone (Curate) on Nov 30, 2000 at 22:59 UTC | |
|
Re: Problem retrieving Web-page using LWP - help!
by kilinrax (Deacon) on Nov 30, 2000 at 23:02 UTC | |
|
Re: Problem retrieving Web-page using LWP - help!
by chipmunk (Parson) on Nov 30, 2000 at 22:43 UTC | |
|
Re: Problem retrieving Web-page using LWP - help!
by wardk (Deacon) on Nov 30, 2000 at 23:18 UTC |