I'm trying to write a script to log into Google Voice and automatically send a text message, periodically. This seemed to me to be a pretty straightforward thing to do, but it is definitely more complicated than I expected. So overall, I guess my question is how to go about this?
But one specific area I'm interested in is how to actually log into a website at all? And whether this is requiring the use of IE, which isn't really the browser I'd prefer to use. Can this be used with, say, Chrome? And if not, what's going to happen when Microsoft finally does away with IE, in favor of Edge or whatever?
Automate website access?
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1384
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Automate website access?
Have you tried the Find IE Element Wizard yet?
Start with creating an IE instance with IECreate.
Then navigate that instance to your login page with IENavigate.
Once you're there, you might want to add a little wait to make sure the page is loaded. Then use the IE Element Wizard I mentioned above to complete the username and password fields, and click the login button.
Regarding Chrome, Edge, and IE, this article might help. Most of us don't use IE as a browser of choice. But while we hate using it as humans, it is still generally the best choice for automation.
Start with creating an IE instance with IECreate.
Code: Select all
IECreate>IE[0]
Code: Select all
IENavigate>IE[0],http://www.mjtnet.com/,ie_res
Once you're there, you might want to add a little wait to make sure the page is loaded. Then use the IE Element Wizard I mentioned above to complete the username and password fields, and click the login button.
Regarding Chrome, Edge, and IE, this article might help. Most of us don't use IE as a browser of choice. But while we hate using it as humans, it is still generally the best choice for automation.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Automate website access?
Thanks. That was really helpful. I'm going to have to play with it more, but still. Now I am still concerned about it remaining consistent, so I think that I want it to use InPrivate mode, so it doesn't attempt to save my username for the future. Does that make sense? Or do I really not need to worry about that?
Otherwise, I think I'm going to be able to move forward okay with this.
Otherwise, I think I'm going to be able to move forward okay with this.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1384
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Automate website access?
It's okay if you don't want it to remember your password.
As an addition you can even make the macro detect whether you're signed in or not, and only sign in if you're not. A login page usually contains some tell-tale text. Let's say in this case it might be "forgot password". We look for that text on the page, and then use IF/ENDIF to sign in if it's found, but not if it doesn't.
Something like this (incomplete) example :
As an addition you can even make the macro detect whether you're signed in or not, and only sign in if you're not. A login page usually contains some tell-tale text. Let's say in this case it might be "forgot password". We look for that text on the page, and then use IF/ENDIF to sign in if it's found, but not if it doesn't.
Something like this (incomplete) example :
Code: Select all
//Does the page contain "forgot password"?
IEContainsText>IE[0],,forgot password,SigninReq
//If the page contains "forgot password", do this
If>SigninReq=1
IETagEventByAttrib>.... username code here (use the IE wizard)
Wait>0.1
IETagEventByAttrib>.... password code here (use the IE wizard)
Wait>0.1
IETagEventByAttrib>.... click submit button code here (use the IE wizard)
Wait>0.1
Endif
Yes, we have a Custom Scripting Service. Message me or go here
Re: Automate website access?
The issue for me isn't the remembering the password part. It's that I have multiple Google IDs that I use for different purposes. I have my business account, and my personal account, for example. And Google's services will remember them all, simultaneously. BUT, you have to make sure that you're using the one you intend to use. And It will also, often, remember my account, and already have the username selected, just waiting for the password. I don't mean that it's already filled into a field. You'd need to look at it to see what I'm talking about. But that can be complicated.
So what I'd rather do, for the purpose of scripting, is just have it log in using its own browser instance, not linked to any other extant instances that may already have credentials in place. This way I can ensure that it's using the one I want, and not have to worry about any of those issues.
So what I'd rather do, for the purpose of scripting, is just have it log in using its own browser instance, not linked to any other extant instances that may already have credentials in place. This way I can ensure that it's using the one I want, and not have to worry about any of those issues.
Re: Automate website access?
Okay, maybe nevermind all that. I've been able to get it logged into the page. The new problem seems to be an IE issue. When I log in using my credentials in Chrome, I get a list of my calls, and the ability to do new things. When I try doing it from IE, even manually, it loads the page partially, but never completes. So I can't do anything more with it. Looks like I'm back to needing to use another browser?