Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^7: javascript login

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


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

it gives an error global symbol $userid requires explicit package name
Perhaps this is because you use strict and these variables are not declared?

Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^8: javascript login
by robertw (Sexton) on Aug 17, 2012 at 19:21 UTC
    I put strict off and it gives no errors, then i ran it and it gave line 6 unknown agent 'firefox' and line 1900 of mechanize.pm says there is no form numbered 2, How can i resolve the first error and where does it say the form of html? sorry I am slow in this but I appreciate your help very much:)
    my $mech = WWW::Mechanize->new(); $mech->agent_alias( 'Firefox' ); $userid = "usr"; $password = "password"; $mech->get( "https://login.binck.nl/klanten/Login.aspx?ReturnUrl=%2fkl +anten%2fdefault.aspx" ); $mech->submit_form( form_number => 2, fields => { userid => "$userid", password => "$password" }, button => "btnSignon" );

      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 mechanize.pm 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.
        Or just $mech->dump_forms;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988071]
help
Chatterbox?
[Corion]: marto: Ow! You got hit by the storm that is bringing warm weather to me ...
[1nickt]: marto Good to hear that was the worst of it for you...
[marto]: 1nickt the worst I'm aware of at the moment :P
LanX .♩..♬ ... Another one bites the Sahara dust ...
marto wonders what fresh hell the firefox update has brought, apart from maxing out CPUs
1nickt was looking into Firefox Extended Support releases yesterday. You don't have to go with the updates!
[erix]: wonderfully red sun here
[LanX]: FF has become a source of instability :(
[1nickt]: erix not so wonderful for the lungs :-(

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-10-17 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (230 votes). Check out past polls.

    Notices?