html - How to trigger an onchange event in Firefox::Mechanize? -
i'm using firefox::mechanize scrape website. i'm stuck on dropdown menu has onchange event associated it.
i'm able select option wanted pulldown menu, , i'm able verify because pulldown shows option selected. doesn't trigger onchange event associated it.
i'm thinking might need "click" event after selecting option, i'm not sure how incorporate that.
here 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 script:
use www::mechanize::firefox; $mech = www::mechanize::firefox->new( tab => 'current', autoclose => 0 ); $mech->get('http://www.mywebsite.com/'); $mech->select("20279", "view");
thanks in advance.
get dom element , send change or click event it:
my $select = $mech->selector('#select20279', => 1); $select->__change(); # or $select->__click();
see also
http://search.cpan.org/~corion/mozrepl-remoteobject-0.39/lib/mozrepl/remoteobject.pm
Comments
Post a Comment