Jump to content
Macro Express Forums

Launch browser, go to specific site, enter a login & pwd


Recommended Posts

I use a financial site which requires a login and password. How do I build a macro to (1) launch internet explorer (2) open a specific IP address (domain name), (3) wait for the page to load, (4) enter username, (5) enter password, then (6) "submit" ?





Those commands are all very basic and well described in ME's comprehensive Help. In particular, read the Index entries for Web Site and Text Type.


But here's an example to get you started. This macro is called Example for jrtaylor and its operation should be clear after studying the commands and my notes below:


// Example for jrtaylor
// First, open the web site, using IE.
Keystroke Speed: 20 Milliseconds
Web Site: [url="http://pgmacros.invisionzone.com/index.php?showforum=2"]http://pgmacros.invisionzone.com/index.php?showforum=2[/url] [internet Explorer - Wait to load]
// Navigate to the Login link by using the Tab key and then Enter
Delay 500 Milliseconds
// Navigate to the Username box by using the Tab key
Delay 100 Milliseconds
// Enter the username
Text Type: terrypin<TAB>
Delay 100 Milliseconds
// Insert similar commands to enter the password, etc
Macro Return


If you're impatient to run this as it stands, before adapting it to your own needs, just paste the code below into an empty Direct Editor box for a new macro.



<REM2:Example for jrtaylor><REM2:First, open the web site, using IE.><SPKEY:0020><HTTP2:2:T:http://pgmacros.invisionzone.com/index.php?showforum=2><REM2:Navigate to the Login link by using the Tab key and then Enter><TEXTTYPE:<TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><ENTER>><MSD:500><REM2:Navigate to the Username box by using the Tab key><TEXTTYPE:<TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB>><MSD:100><REM2:Enter the username><TEXTTYPE:terrypin<TAB>><MSD:100><REM2:Insert similar commands to enter the password, etc><MRETURN>



- The macro goes to the ME forum site and starts to log me in. You'd do broadly the same for your financial site.

- To work out how to navigate to the login link and the username box I had to follow an obvious but crucial principle: first observe exactly how I do this manually. So, for example, I found that no fewer than 14 Tabs were needed to reach the login link, and 18 to get subsequently to username. (If you were confident of the IE window always sized and positioned consistently, you could instead achieve these with mouse clicks.)

- I added the Keystroke Speed command because there's a lot of text entry involved and I wanted to slow it down a bit

- Even so, as happens with almost all my macros, my first few attempts failed. I got it working only after adding those various delays. Some of them might prove redundant after more methodical testing, but for a few hundred milliseconds it's of no significance in this case. One delay that seemed critical was the 500 ms; much shorter and the macro failed, probably 'running ahead of itself'. So, trial and error will often be involved! <_<



Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...