Hi All,
I am working on a script to automate downloading files from a website. I am using LWP::UserAgent. I need to parse the output from the returned content to get the value of the TOKEN:
<input name="org.somescript.html.TOKEN" type="hidden" value="f152a40cd9234c57542ee5b0c057cb0b" />
my $browser = LWP::UserAgent->new();
$browser->cookie_jar( {} );
#Post to some URL with some data
$url="https://somesite.com/LoginAction.do";
my $req0 = HTTP::Request->new(GET => $url);
my $resp0 = $browser->request($req0);
# Response can be read like this:
print $resp0->content;
the print $resp0->content; line returns the entire html code from the site. I have tried endlessly to parse the content for just the TOKEN Value. Can any one recommend a method? Thanks!