Sign in to follow this  
Followers 0
speedi

ie.au3 does not work with IE7

10 posts in this topic

my script worked great with internet explorer 6 but will not work with IE7

#include <IE.au3>

$IE = _IECreate()

WinSetState($IE, "", @SW_MAXIMIZE)

$URL = "https://investment1s.ameritrade.com/cgi-bin/apps/LogIn"

_IENavigate($IE, $URL)

Any help would be appreciated....

Share this post


Link to post
Share on other sites



WinSetState($IE, "", @SW_MAXIMIZE)

This is terribly wrong. Please look at WinSetState() and _IEPropertyGet() in the help file.

Could you please tell us what 'doesn't work' means? What's this code's behaviour?

Share this post


Link to post
Share on other sites

WinSetState($IE, "", @SW_MAXIMIZE)

This is terribly wrong. Please look at WinSetState() and _IEPropertyGet() in the help file.

Could you please tell us what 'doesn't work' means? What's this code's behaviour?

Sorry,

code to problem follows:

#include <IE.au3>

$IE = _IECreate()

WinSetState($IE, "", @SW_MAXIMIZE)

$URL = "https://investment1s.ameritrade.com/cgi-bin/apps/LogIn"

_IENavigate($IE, $URL)

;WinSetState("Log on to TD AMERITRADE", "", @SW_MAXIMIZE)

WinActivate("Log on to TD AMERITRADE")

Sleep(1000)

Send("username{tab}password{ENTER}")

with IE6, the "Log on to TD Ameritrade" page opens and the cursor is sitting in the box where the send command sends the username.

then the tab moves to the password box where the password is entered by the same send command.

With IE7, the "Log on to TD Ameritrade" page opens, but the script stops there. I don't know why.

That SW_MAXIMIZE does maximize the window... Another forum member gave me those 1st 5 commands..

thanks for any help you can provide. Jim

Share this post


Link to post
Share on other sites

That SW_MAXIMIZE does maximize the window... Another forum member gave me those 1st 5 commands..

Only by fluke, they gave you some bad information. That code actually just maximizes the active window [because $IE looks like an empty string, try it yourself with MsgBox(0, '', $IE)].

As for your actual script, let me just verify something, you're saying that the script gets as far as the bold red line here:

#include <IE.au3>

$IE = _IECreate()

WinSetState($IE, "", @SW_MAXIMIZE)

$URL = "https://investment1s.ameritrade.com/cgi-bin/apps/LogIn"

_IENavigate($IE, $URL)

;WinSetState("Log on to TD AMERITRADE", "", @SW_MAXIMIZE)

WinActivate("Log on to TD AMERITRADE")

--------------------------------

Sleep(1000)

Send("username{tab}password{ENTER}")

Is that correct? Well you're done with the IE stuff at that point, so it's hardly a problem with IE.au3. I would say that it's an issue with the tabs, or maybe with whatever is supposed to highlight the correct input boxes on your webpage. That's what changed moving to IE7. Have a look at the source of your page, see if you can find out ID names for the controls you're trying to set, then look at using _IEFormElementSetValue to set the values instead of using Send().

Just so you know, Send() is an extremely unsafe way to enter a password into something. I created a script myself for logging into Steam, I left it in the hands of my brother so he could use my login when I wasn't around, I did all kinds of checking to make sure I didn't type my password somewhere it shouldn't... he still figured out a way around it, and the end result was that the script typed my username and password into Notepad!

Share this post


Link to post
Share on other sites

Also note that if the difference between the systems is not only IE6 and IE7 but also Windows XP and Vista, there are also issues introduced by the new Vista security model that causes _IECreate to open two browser instances and can cause grief. Easiest way around this is using #RequireAdmin if possible. See my sig for more info.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Only by fluke, they gave you some bad information. That code actually just maximizes the active window [because $IE looks like an empty string, try it yourself with MsgBox(0, '', $IE)].

As for your actual script, let me just verify something, you're saying that the script gets as far as the bold red line here:

Is that correct? Well you're done with the IE stuff at that point, so it's hardly a problem with IE.au3. I would say that it's an issue with the tabs, or maybe with whatever is supposed to highlight the correct input boxes on your webpage. That's what changed moving to IE7. Have a look at the source of your page, see if you can find out ID names for the controls you're trying to set, then look at using _IEFormElementSetValue to set the values instead of using Send().

Just so you know, Send() is an extremely unsafe way to enter a password into something. I created a script myself for logging into Steam, I left it in the hands of my brother so he could use my login when I wasn't around, I did all kinds of checking to make sure I didn't type my password somewhere it shouldn't... he still figured out a way around it, and the end result was that the script typed my username and password into Notepad!

Thanks for all help. I have resolved the problem by changing the script top this:

--------------------------

#include <IE.au3>

$IE = _IECreate("https://investment1s.ameritrade.com/cgi-bin/apps/LogIn",0,1,1,0)

WinSetState($IE, "", @SW_MAXIMIZE)

WinActivate("Log on to TD AMERITRADE")

Sleep(1000)

Send("username{tab}password{ENTER}")

-------------------------

But I have a question about your "unsafe" comment... Why is it unsafe? I compile the script and unclick the decompile option - so none can see the script... I names it something unusual.... I keep the actual script in a password protected zip file.... Any thoughts are appreciated about this...

Share this post


Link to post
Share on other sites

Also note that if the difference between the systems is not only IE6 and IE7 but also Windows XP and Vista, there are also issues introduced by the new Vista security model that causes _IECreate to open two browser instances and can cause grief. Easiest way around this is using #RequireAdmin if possible. See my sig for more info.

Dale

I use XP - Thanks for the info.. What does this mean? -- SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

But I have a question about your "unsafe" comment... Why is it unsafe? I compile the script and unclick the decompile option - so none can see the script... I names it something unusual.... I keep the actual script in a password protected zip file.... Any thoughts are appreciated about this...

Picture this, here's your script, running along just fine...

#include <IE.au3>
$IE = _IECreate("https://investment1s.ameritrade.com/cgi-bin/apps/LogIn",0,1,1,0)
WinSetState($IE, "", @SW_MAXIMIZE)
WinActivate("Log on to TD AMERITRADE")
Sleep(1000) ; <-- Right now I run Notepad.exe and make it the active window. Guess where the username and password get typed.
Send("username{tab}password{ENTER}")

Note the comment on the Sleep() line. This is similar to how my brother caught my password. This is not a big deal as long as you're just running it on your own system, and nobody has access to your desktop, but just be careful you don't leave the application lying around where someone could run it (or copy it and run on their own machine).

*Edit: Hit add reply instead of preview and forgot the whole part after the code tags.

Edited by Saunders

Share this post


Link to post
Share on other sites

Picture this, here's your script, running along just fine...

#include <IE.au3>
$IE = _IECreate("https://investment1s.ameritrade.com/cgi-bin/apps/LogIn",0,1,1,0)
WinSetState($IE, "", @SW_MAXIMIZE)
WinActivate("Log on to TD AMERITRADE")
Sleep(1000) ; <-- Right now I run Notepad.exe and make it the active window. Guess where the username and password get typed.
Send("username{tab}password{ENTER}")

Note the comment on the Sleep() line. This is similar to how my brother caught my password. This is not a big deal as long as you're just running it on your own system, and nobody has access to your desktop, but just be careful you don't leave the application lying around where someone could run it (or copy it and run on their own machine).

*Edit: Hit add reply instead of preview and forgot the whole part after the code tags.

Question: Can I have my script access my system MAC address and check that. Or can a system MAC address be changed? Thanks!

Share this post


Link to post
Share on other sites

I'm sure it's possible. I don't know how, though. The MAC is loaded into the registry I believe. I've used MAC changing software in the past.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0