Jump to content
Macro Express Forums

How To: Login Automatically To Web Sites


Recommended Posts

The {Generate an Internet Login} function creates a macro that will launch, activate, and log in to a web site that requires a user ID and password. It is a heavy function, which means that it carries with it all the code necessary to generate its target macro, including the VBScript code. The target macro is written to your desktop as a playable (.mxe) file and will contain everything it needs to run, including its own VBScript code. It is what we call a zero-footprint macro, meaning that it will run standalone without needing the support of any other function, macro, or external file. It generates, all by itself, everything it needs to work.

 

I do not want to get into too much detail here as to how the {Generate an Internet Login} function works because you can read that within the function's code and inline docs. But here are some points:

  • It must be imported into the PGM Functions Library in order to run because it uses some supporting functions within the Library.
  • It only works with Internet Explorer.
  • Any open web pages will be automatically closed while generating target macro.
  • The information displayed by the prompts and text boxes will help guide you through the generation process.
  • It uses your temporary folder to create whatever files it needs to run, which are deleted at the end.
  • The target (resulting) macro that this function generates will contain everything it needs to work.
  • You do not have to be at the target web page when this function starts. You will have an opportunity to navigate to it when the time comes.

When the function starts you are prompted to enter a URL, which is the web page that contains the user ID and password fields. Knowing how long and weird these URLs can be, the function was designed to allow navigation to the web page while the macro is running. This means that you can type any URL into the prompt, and then after the function takes you there, navigate to the correct web page. This is explained in the text box as the function is running.

 

Once you acknowledge the correct web page, the macro copies the address and closes IE because the underlying VBScript will launch its own web page instance and the user may get confused if two identical web pages are on the screen.

 

The VBScript, which is launched by the function at this point, captures more than just your typed user ID and password. It also captures the related DOM <INPUT> tags of the relevant fields. This is accomplished by comparing which fields have data when the web page is closed. It is the OnQuit Event that tells the VBScript to get the data. So it is important to remember that after you enter your user ID and password, NOT to hit the <Enter> key or engage the <Submit> button but instead, just simply close the IE window. Again, this is explained in the text box as the function is running.

 

The function will take control back once VBScript has recorded the data to a temporary file. Now you are prompted to confirm the user ID and password and to enter a name for the playable (.mxe) file that is about to be generated.

 

That's it. In order to test the newly created macro, simply click on it. I have used this function to generate macros for PayPal, credit card, banking, eBay, membership, and other web sites, and have never encountered a problem.

 

Let us know how it goes with you. Tell us any problems, opinions, suggestions, and so forth that you have.

 

2005.06.01 - JLW - Test for "https" in input string.

Generate_an_Internet_Login_A.mxe

Link to comment
Share on other sites

I don't have the PGM library to run this yet... but I just want to clarify something. Running the Macro for the first time will close all IE windows. Will it also close all IE windows when it is run after that?

 

Nevermind... read through the entire macro. Disregard this question.

Link to comment
Share on other sites

I just tested that and it did not close the windows. It opened a new IE session and ran. But I did notice whereas with no windows open it would open the window, fill in the info AND submit it. When I tested it with another window open it started a new window, filled in the info but DID NOT submit it.

Link to comment
Share on other sites

Bob -

 

Thanks for the input.

 

Opening and closing windows: The target macro that gets generated does not close any IE windows when it is fired. This is only done by the {Generate an Internet Login} function as you are creating the target macro. When you stated

When I tested it with another window
did you mean another IE window or any window?

 

Acct and PIN fields: I think the problem may be that there is no HTML <INPUT TYPE=PASSWORD> type field. Currently this data mining macro works only if there is at least one <INPUT TYPE=TEXT> and <INPUT TYPE=PASSWORD> field. I will look further into this.

Link to comment
Share on other sites

did you mean another IE window or any window

No, I meant an IE window and yes, as I stated it does not close any that are open. But if there are any IE windows open the running of a login macro will not hit any submit button where it does whjen it is the only ie window open.

 

Acct and PIN fields: I think the problem may be that there is no HTML <INPUT TYPE=PASSWORD> type field. Currently this data mining macro works only if there is at least one <INPUT TYPE=TEXT> and <INPUT TYPE=PASSWORD> field. I will look further into this.

 

Gotcha! Sort of thought so. Did you experience the wrong URL coming up initially. It may be my system since I seem to have the lop.com adware problem.

Link to comment
Share on other sites

Hello Bob!

 

Did you experience the wrong URL coming up initially

Yes. The problem was the macro only tested the input string for an occurrence of "http://" and would prepend it (real word?) if it was not found resulting in "http://https://ezonline.ibmtefcu.org". I changed the macro to also test for "https://" and posted it.

 

 

Edited (added to response):

 

But if there are any IE windows open the running of a login macro will not hit any submit button where it does whjen it is the only ie window open

I've tried duplicating this problem without success. I can have many IE windows open, including a clone of the one that the target macro will open, and everything still works fine. The User ID and Password get entered, and submitted without fail.

 

The underlying VBScript is designed to launch its own instance of IE, navigate to the designated web page, fill in the fields, then hit the <Enter> key via a call to objShell.SendKeys. In other words, the "Submit" button is never touched under any circumstance.

Link to comment
Share on other sites

It is probably the same thing that Bob ran into in his post. I think the problem may be that there is no HTML <INPUT TYPE=PASSWORD> type field. Currently this data mining macro works only if there is at least one <INPUT TYPE=TEXT> and <INPUT TYPE=PASSWORD> field. I will look further into this.

Link to comment
Share on other sites

I have 2 email addresses at the same site;

Yor program reloads the previous login when I run the next login, unpredictably unable to get into the second for a while?

Randall

EDIT; DON"T WORRY!; this appears to be normal behaviour for this site outside of the macro if the forst login is still active

Link to comment
Share on other sites

Hello Randall!

 

It is true that some web sites act this way. If you do not log out prior to exiting, it assumes that you are still the same person when logging back in even though you have different identities. PayPal is like this and so is Netscape. I have gotten into the habit of logging out ... which is a good habit as habits go!

 

I still want to determine if it will be possible to generate a macro for those sights that do not contain a <INPUT TYPE=PASSWORD> field.

Link to comment
Share on other sites

Hello Bob!

 

Try creating a login macro using this link and then let us know the results. The page will look strange because it is actually an unformatted FRAME within the main page. A FRAME, however, is just another link to another page. If this works then we will determine what it will take to resolve this type of FRAME situation.

 

By the way, within the FRAME are standard TEXT and PASSWORD fields ... which makes sense.

Link to comment
Share on other sites

Hi, Joe,

Are you able to do a similar thing wit Hotmail? I presume I can't test Bob's site?

 

Is the password testing just for a process and "proof of concept"? I would not be happy to make such shortcuts to a banking site, for instance; all the macros I make for such sites have incomplete passwords. The worry after losing a laptop etc with those macros intact would be extreme?

Randall

Link to comment
Share on other sites

Randall:

The worry after losing a laptop etc with those macros intact would be extreme?

This is VERY true. Anybody that generates a macro like this, whether with Macro Express or some other software, should always be aware that the logins and passwords are right there on the hard drive. Yes, they are buried inside scripts and text, but they are still there. The downside to convenience I guess. <_<

 

Bob:

Just tested it with the A version of code and the link provided and it worked like a charm!

Great news! Thanks. At least we know for sure what the problem was.

 

Edited/Added:

After doing some investigation into the FRAMES problem, we are leaning towards not handling these types of logins in this release.

 

A workaround for the user would be to view the source (View | Source) and retrieve the link inside the <IFRAME> tag, which is what I did. Again, this is just how we are leaning. A final decision has not yet been made. We still need to determine if there are a lot of these types of login sites compared to what we are already handling.

Link to comment
Share on other sites

Randall:

Are you able to do a similar thing wit Hotmail? I presume I can't test Bob's site?

Have not looked at Hotmail yet, but I will.

 

Is the password testing just for a process and "proof of concept"?

No. I have personally set up over 20 logins and use them on a daily basis. They are called from a menu. Each one I generate goes into a folder on the server. When I want to log in to a web site, I run a macro that dynamically gathers them into a Multiple Choice menu. Then I just click on my choice.

 

The advantage of this approach is that I need only to generate a login and save it to the same folder as the others. Since the macro builds the menu dynamically, the new login is automatically included as a choice. The macro itself is fired by simply clicking my mouse in the upper-left corner of my display. Obviously, it is a Mouse Click activated macro. Very clean. Very quick. Very easy!

Link to comment
Share on other sites

I am waiting to test this function... but I have a question that came to mind. We use our corporate log in and password to access many sites on the intranet. We are required to change this password about once a month. Is there something in the design that would allow for changing the password without having to re-run the macro set-up?

Link to comment
Share on other sites

Is there something in the design that would allow for changing the password without having to re-run the macro set-up?

No. That would be a different macro, though it would very easy to create.

 

You can, however, simply load the generated mxe file into any text editor, search for the password, change it, and save it.

Link to comment
Share on other sites

Wanna share the multiple choice macro. Sounds nice.

Here is the {IE Login Popup Menu} function. You will need to edit it to change the repository folder to suit your requirements. The function is well documented and the Mouse Click activation was left intact. Feel free to change this, or anything else to suit your needs.

IELoginPopupMenu.mex

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.

Guest
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.

Loading...
 Share

×
×
  • Create New...