This is my first post to perlmonks. I have been using Perl for about 4-5 years and I need help with a script that I'm writing.
I want to click a checkbox using www::mechanize. The html for the checkbox looks like this:
<td><input id="chklstCC_0" type="checkbox" name="chklstCC:0" onclick="__doPostBack('chklstCC:0','')" language="javascript" /><label for="chklstCC_0">Visa</label></td>
When the checkbox VISA is clicked, the javascript __doPostBack brings up more fields (newfield1,newfield2) on the htmlpage that I want to fill in as well.
My script never finds newfield1 nor newfield2 because the checkbox is never getting clicked by www::mechanize.
My code for checking the checkbox looks like this:
my $agent = WWW::Mechanize->new();
my $chk_visa = "chklstCC:0";
$agent->tick($chk_visa);
Is this correct?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|