Unfortunately, the only way I can target the button is to use the key/value pair I have used in the code. The HTML is a bit odd, but it belongs to a third party and I have little control over it. It looks like below (posting just the body portion of it which includes the logon form)-
<body>
<h1>Account -- Log In</h1>
<div id="content">
<form method="post">
<table id="login" cellpadding="0" cellspacing="0">
<tr>
<th colspan="2" class="right">Log In</th>
</tr>
<tr>
<td class="label">Username:</td>
<td class="right">
<input type="text" name="login" value="" size="15"
+/>
</td>
</tr>
<tr>
<td class="label">Password:</td>
<td class="right">
<input type="password" name="passwd" size="15"/>
</td>
</tr>
<tr>
<th colspan="2" class="last">
<input type="submit" value="Login now"/>
</th>
</tr>
</table>
<input type="hidden" name="action" value="login"/>
</form>
<a href="/">Speed Fulfillment & Call Center Home</a>
</div>
</body>
as you can see that the button is actually a form submit element. So having said this, i have also tried $mech->submit() , but it did not work either. |