rbasche Posted February 24, 2009 Share Posted February 24, 2009 (edited) Hello everybody, I am an AutoIt newbie and I am doing my first steps in AutoIt. As I want to automate a weekly cumbersome weekly task which involves reading strings out of a web page <i am doing my first tries with the _IE<x> functions. Now at the very first step I have an unwanted behaviour and I dont know whether I have a bug or I am simply doing something wrong. The code I try is #include <IE.au3> _IECreate("http://www.autoit.de", 1, 1) which leads to have 2 IE windows open, one blank page and a second one with the www.autoit.de page. It is AutoIt V 3.3 with Windows Vista Home Premium SP1. Any help will be appreciated Regards, Rüdiger Edited February 24, 2009 by rbasche Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 24, 2009 Share Posted February 24, 2009 Are you saying that when you run this code, (without IE started) that you end up having two Internet Explorer instances, one to the correct page, and one just blank. Also, are they always blank then the web page, or does it occasionally switch up on the order they appear? I hope with you answering some more questions you will get the answers you're looking for. You will need to be sure to continue to work hard to try and workout different examples. Thanks, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
rbasche Posted February 24, 2009 Author Share Posted February 24, 2009 (edited) Jarvis,in fact I reduced the code to the very smallest part I could. All I tried led me to to described effecta blank page opensit is always the blank page which opens firstthen a second IE windows opens with the desired web pageI also tried to have#include <IE.au3> $url = "http://www.heise.de" $oIE = _IECreate() $rc = _IENavigate($oIE,$url,1)Knowing that the first call will definitly open a blank page, but expecting to have the _IENavigate call to go to the desired page in a second step, but I get also 2 IE windows if I try that.Adding this in a second edit:Could it be a language problem, as I use a german windows for my tries? Edited February 24, 2009 by rbasche Link to comment Share on other sites More sharing options...
Authenticity Posted February 24, 2009 Share Posted February 24, 2009 #include <IE.au3> Global Const $navOpenInNewTab = 0x0800 Dim $hWnd = WinGetHandle('[CLASS:IEFrame]'), $o_IE Dim $sURL = 'http://www.autoitscript.com/' If Not @error Then $o_IE = _IEAttach($hWnd, 'HWND') If Not IsObj($o_IE) Then $o_IE = _IECreate($sURL) Else $o_IE.Navigate2($sURL, $navOpenInNewTab) EndIf Else $o_IE = _IECreate($sURL) EndIf Please read the comments in _IECreate() related to Vista users. Link to comment Share on other sites More sharing options...
rbasche Posted February 24, 2009 Author Share Posted February 24, 2009 (edited) Authenticity, thank you, I tried your code, bit I still have the same effect. Edit added: When executing you code, I now see the script also beeing paused in the windows task bar. Please read the comments in _IECreate() related to Vista users. Which comments do you mean? All I find in IE.au3 mentioning Vista is this V2.4-0 12/31/07 Fixes _IELoadWait looping logic corrected to prevent nuisance console COM messages with small loadwait timeouts _IEAttach embedded and dialogbox modes update DllCall syntax (hopefully works with bugfix to DllCall post 3.2.10.0 that caused embedded to fail) _IEAttach moved Shell.Window object creation after embedded/dialogbox logic so that they can run without explorer.exe running _IECreate and _IENavigate documentation, added Windows Vista UAC information _IEFormElementGetValue returns NULL string if value is NULL instead of integer 0 Also in the AutoIt help file describing the IE Management I did not find any remark on Vista. Do I miss something? I tried to upgrade AutoIt from V3.2 to V3.3 before I did my tries, did anything go wrong with this? Edited February 24, 2009 by rbasche Link to comment Share on other sites More sharing options...
Authenticity Posted February 24, 2009 Share Posted February 24, 2009 The comments (or I should said remarks) in the help file regarding _IECreate():New security in Windows Vista... Link to comment Share on other sites More sharing options...
rbasche Posted February 24, 2009 Author Share Posted February 24, 2009 Found it!New security in Windows Vista causes a new browser window to be created when a browser is instructed to navigate to a URL in a different security zone. This occurs as well with the initial creation and navigation initiated with _IECreate. The new window is a new browser instance and the previous browser object variable no longer points to it. There are several workarounds: 1) add #RequireAdmin to your code (this is required even if the account is part of the Administrator's Group and will propmt for credentials if necessary), 2) use _IEAttach to connect to the new browser window 3) add the target website to the Trusted Sites security zone in IE, 4) turn off "Protected Mode" in IE, or 5) disable UAC. Care must be taken to understand the implications of disabling IE security features when accessing untrusted sites.Hm, as far as I understand it, a _IEAttach should help, will try that but not now, as it is 22:45 and I have to get up at 05:30As I want to use the code at business, where XP si used, it should work there then.Well I wanted to develop much of the code at home, as I have no other hobbies, apparently :-)Thanks a lot for your help and patience! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now