Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^9: javascript login

by aitap (Deacon)
on Aug 17, 2012 at 19:43 UTC ( #988082=note: print w/ replies, xml ) Need Help??

in reply to Re^8: javascript login
in thread javascript login

I put strict off and it gives no errors,
It is recommended to put it back on and declare variables properly.

then i ran it and it gave line 6 unknown agent 'firefox'
This is because there is no agent alias called "Firefox". Use known_agent_aliases() to get available names, for example:
$ perl -MWWW::Mechanize -E'say join ", ",WWW::Mechanize::known_agent_a +liases' Linux Konqueror, Linux Mozilla, Mac Mozilla, Mac Safari, Windows IE 6, + Windows Mozilla

and line 1900 of says there is no form numbered 2
Try using Data::Dumper and forms() method to get the list of forms available for WWW::Mechanize.

Sorry if my advice was wrong.

Comment on Re^9: javascript login
Download Code
Replies are listed 'Best First'.
Re^10: javascript login
by Anonymous Monk on Aug 17, 2012 at 19:45 UTC
    Or just $mech->dump_forms; gives an error because when i
      $mech->dump_forms( [" +rl=%2fklanten%2fdefault.aspx"] ); Not a GLOB reference # print {$fh} $form->dump, "\n"; gives an error sub dump_forms { my $self = shift; my $fh = shift || \*STDOUT; for my $form ( $self->forms ) { print {$fh} $form->dump, "\n"; } return; }
       $mech->dump_forms( [""] );

        I solved the problem, I switched perl, system perl (mac) is outdated, i need to upgrade that one, now it gives me the response WWW::Mechanize=HASH(0x100970d08)->dump_forms( HTTP::Response=HASH(0x100b5b118) );

        What do I have to fill in in form number right now?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988082]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-11-27 13:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (729 votes), past polls