WWW-Mechanize - Re: Dinamically setting form action

Posted on Mon Oct 16 20:08:45 2006 by gdakram in response to 3264 (See the whole thread of 4)
Re: Dinamically setting form action
If I am understanding you correctly that is -
1. Copy the html content into a variable
2. Do regex substitution to change your form action inside that variable
3. Update the mechanize object with that variable

For example -
$content = $mech->save_content(); $content =~ s/(form.+?action=").+?(")/$1<YOUR DESIRED ACTION>$2/i; $mech->update_html($content);

Hope that helps!
Direct Responses: 3272 | Write a response