Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Mechanizing around Javascript

by Gangabass (Vicar)
on Apr 26, 2013 at 12:26 UTC ( #1030813=note: print w/replies, xml ) Need Help??


in reply to Mechanizing around Javascript

There is no form #2 on your login page. I recommend you to rewrite your code like this:
$mech->get($url); my $usr = "asdf"; #marked out for post my $pw = "asdffgg"; $mech->submit_form ( with_fields => { login_name => $usr, user_password => $pw, }, );
Also there is no need to use follow_link with absolute URL just use get

Replies are listed 'Best First'.
Re^2: Mechanizing around Javascript
by PerlSufi (Friar) on Apr 26, 2013 at 14:21 UTC
    Thanks. I have used the get() to receive my page, but I am still having problems getting te file by clicking a button in a form named "searchForm". It doesn't recognize the form id
      Please show HTML code you have in your browser for this page (usually you can get it by pressing Ctrl+U).
        performing control+U on the page gives me:
        <script type="text/javascript" src="/POSecureURL/scripts/SecureURL.js" +></script> <html> <head> <TITLE>USPS PostalOne!</TITLE> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> var front_door = true; var loggedin = 1; var ary_spawned_windows = new Array(); function refreshbottom() { parent.frames["portal_hidden"].location="hidden.cfm"; } function startup() { forceFrameToTop(); refreshbottom(); window.defaultStatus = "USPS PostalOne!"; } function forceFrameToTop(){ if ( window != top ){ top.location.href = location.href; } } </SCRIPT> </head> <FRAMESET ROWS="100%,*" FRAMEBORDER="0" BORDER="0" BORDER="0"> <FRAME SRC="https://www.uspspostalone.com/CIMweb/owner.do?group_na +me=Mailer&landing=Dashboard" NAME="portal_main" title="Main Applicati +on Frame for Postal1" SCROLLING="AUTO"> <FRAME SRC="hidden.cfm" NAME="portal_hidden" title="Hidden System +Frame for Postal1" SCROLLING="NO"> </FRAMESET> <BODY onload="startup();" bgcolor="FFFFFF"> </BODY> </html>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2018-10-22 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (119 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!