wataguy has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to read a page, change a form value, and then reload the page.
I can get the page OK, but I haven't been able to do the rest.
I've tried things like this:
$ua = LWP::UserAgent->new; my $req = POST 'http://thesite/thepage.aspx', [ errors => 0 ]; $html = $ua->request($req)->as_string; $html =~ /name="__VIEWSTATE" value="([^"]+)"/s; $viewState = $1; my $req = POST 'http://thesite/thepage.aspx', [ __EVENTTARGET => 'theItemID', __EVENTARGUMENT => 'newValue', __VIEWSTATE => $viewState, errors => 0 ]; $html = $ua->request($req)->as_string;
but no joy.
I'll be happy to buy anyone who reveals the secrets of this mystery a beer the next time they're in Phnom Penh. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ASP postBack from Perl?
by Jaap (Curate) on Jun 11, 2005 at 10:40 UTC | |
by wataguy (Initiate) on Jun 11, 2005 at 10:57 UTC | |
|
Re: ASP postBack from Perl?
by kaif (Friar) on Jun 13, 2005 at 04:14 UTC | |
by wataguy (Initiate) on Jun 13, 2005 at 04:57 UTC | |
|
Re: ASP postBack from Perl?
by EvanCarroll (Chaplain) on Aug 21, 2008 at 20:28 UTC |