I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-09-22 10:29:51-07 by navraj
Unable to select Log Off button
Hi, I'm writing a peice of code to log into mailbox using webmail and logoff from there. The problem I face here is I'm able to login but not logoff, On the web page LogOff is an image which when clicked runs a javascript. i get the following error There is no form numbered 1. at E:\getMails.pl line 25 Can't call method "find_input" on an undefined value at C:/Perl/site/lib/Win32/I E/Mechanize.pm line 1219. HTML snippet for LogOff button/image is a id="lnkLogoff" class="ntbBtn" href="#" onclick='_e(this,this._e_onclick)' _e_onclick="logOff();" Here is the code so far.
use Win32::IE::Mechanize; $url = "https://url"; my $ie = Win32::IE::Mechanize->new( visible => 1 ); $ie->form_name( $form_name ); $ie->get( $url ); $ie->submit_form( form_name => $form_name, fields => { username => '', password => '', } ); while($ie->{agent}->Document->readyState !~ /complete/i){ sleep(0.5); } sleep 2; $ie->click_button(name => 'Log Off');
-RNK
Direct Responses: Write a response