I'm using Firefox::Mechanize to scrape a website. I'm stuck on a dropdown menu which has an onchange event associated with it.
I'm able to select the option I wanted from the pulldown menu, and I'm able to verify this because the pulldown now shows the option I selected. But it doesn't trigger the onchange event associated with it.
I'm thinking I might need a "click" event after selecting my option, but I'm not sure exactly how to incorporate that.
Here is the bit of HTML:
<select class="" id="select20279" name="20279" onchange="selectAction(this, this.options[this.selectedIndex].value, '20279');">
<option value="">please choose</option>
<option value="edit">Edit</option>
<option value="view">View</option>
<option value="delete_now">Delete</option>
</select>
Here is my script:
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new( tab => 'current', autoclose => 0 );
$mech->get('http://www.mywebsite.com/');
$mech->select("20279", "view");
Thanks in advance.