philkryder Posted January 17, 2014 Posted January 17, 2014 (edited) Two days ago, two of my EXEs and associated scrips stopped working. Since then I downloaded and installed the latest autoit and SciTE: >Running:(3.3.10.2):C:Program Files (x86)AutoIt3autoit3.exe SciTE Version 3.3.7 Dec 12 2013 20:45:19 I've tried to build a simple sample to exhibit the problem as follows: ;=============================================================================== Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declare Opt("WinTitleMatchMode", -1); ; match from start - case insensitive #include <IE.au3> ; Local $oIE = _IECreate("https://yahoo.comcounties.dcss.ca.gov/main/default.asp",0,0,0) ;Local $oIE = _IECreate("www.google.com", 1, 1, 0) ;Local $oIE = _IECreate("www.google.com", 0, 0, 0) Local $oIE = _IECreate("https://counties.dcss.ca.gov/main/default.asp",0,0,0) Local $sExtendedSave = @extended Local $sErrorSave = @error sleep(10000) ConsoleWrite( "$oIE>" & $oIE & "<"& @CRLF _ & "$sExtendedSave>" & $sExtendedSave & "<"& @CRLF _ & "$sErrorSave>" & $sErrorSave &"<"& @CRLF _ ) Local $sHTML = _IEDocReadHTML($oIE) Local $sExtendedSave = @extended Local $sErrorSave = @error ConsoleWrite( "$oIE>" & $oIE & "<"& @CRLF _ ; & "$oHTML>" & $oHTML & "<"& @CRLF _ & "$sExtendedSave>" & $sExtendedSave & "<"& @CRLF _ & "$sErrorSave>" & $sErrorSave &"<" & @CRLF & @CRLF _ & "$sHTML>" & $sHTML &"<" & @CRLF & @CRLF _ ) Exit The console output I get from this run is: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "S:OperationsReports_PredictNonPaymentQ553programstestCreate.au3" /UserParams +>11:40:03 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ; Keyboard:00010409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409 Keyboard:00010409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) >Running AU3Check (3.3.10.2) from:C:Program Files (x86)AutoIt3 +>11:40:03 AU3Check ended.rc:0 >Running:(3.3.10.2):C:Program Files (x86)AutoIt3autoit3.exe "S:OperationsReports_PredictNonPaymentQ553programstestCreate.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop $oIE>< $sExtendedSave>0< $sErrorSave>0< --> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IEStatus_InvalidObjectType (Expected document element) $oIE>< $sExtendedSave>1< $sErrorSave>4< $sHTML>0< +>11:40:14 AutoIt3.exe ended.rc:0 >Exit code: 0 Time: 11.002 ErrorCode 4 is not documented in the help for _IEDocReadHTML All help appreciated. thanks Phil Edited January 17, 2014 by philkryder
philkryder Posted January 17, 2014 Author Posted January 17, 2014 A little more data on this. When I change to use google.com this works ok. The inference I draw is that something is different about that website or the internet options that control it in our trusted zone: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "S:OperationsReports_PredictNonPaymentQ553programstestCreate.au3" /UserParams +>11:42:54 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ; Keyboard:00010409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409 Keyboard:00010409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) >Running AU3Check (3.3.10.2) from:C:Program Files (x86)AutoIt3 +>11:42:54 AU3Check ended.rc:0 >Running:(3.3.10.2):C:Program Files (x86)AutoIt3autoit3.exe "S:OperationsReports_PredictNonPaymentQ553programstestCreate.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop $oIE>< $sExtendedSave>0< $sErrorSave>0< $oIE>< $sExtendedSave>0< $sErrorSave>0< $sHTML><HTML itemtype="http://schema.org/WebPage" itemscope=""><HEAD><TITLE>Google</TITLE> <META content=IE=edge http-equiv=X-UA-Compatible> <META content="text/html; charset=UTF-8" http-equiv=content-type> .... etc...
philkryder Posted January 17, 2014 Author Posted January 17, 2014 (edited) in desperation, I added console writes to in ternal function __IEIsObjType With Google as the target website, the IWebBrowser2 object name stays consistent thru all 4 recursive iterations. (edited to correct the pasted text). --> IE.au3 T3.0-1 Error from function __IEIsObjType, after set $pks_name> --> IE.au3 T3.0-1 Error from function __IEIsObjType, after set $pks_name> >1:IWebBrowser2:documentContainer >2:IWebBrowser2:window >3:IWebBrowser2:browser >4:IWebBrowser2:browserdom< :4 When I change the website to my target, the IWebBrowser2 object name disappears on the 4th recursive iteration. (this is shown by the null string between the two colons in >4::browserdom< Is there a better way to get diags to see what corrupting this object? --> IE.au3 T3.0-1 Error from function __IEIsObjType, after set $pks_name> >1:IWebBrowser2:documentContainer >2:IWebBrowser2:window >3:IWebBrowser2:browser >4::browserdom< :4 Edited January 17, 2014 by philkryder
gruntydatsun Posted January 17, 2014 Posted January 17, 2014 I have had some issues on Win764bit and IE9 too. No object created when I use _IECreate but it seems to work fine when I use _IEAttach on an existing instance of ie9.
philkryder Posted January 18, 2014 Author Posted January 18, 2014 so... ...The inference I draw is that something is different about that website or the internet options that control it in our trusted zone: I removed the target website *.ca.gov from my IE trusted sites. it then returns to normal... Does anyone have any ideas why having a site in an IE trusted zone would cause the AUTOIT object to get corrupted? or, alternatively are there better diags I could use to find what is causing this? thanks Phil
philkryder Posted January 18, 2014 Author Posted January 18, 2014 this seems to be the opposite of the problem described in the _IECreate help file (below). In this instance moving the target website to the Trusted Sites ***CAUSED*** the object to not be found. Removing the target website from the Trusted Sites fixed the problem. Any guidance here on what is happening? thanks. Phil 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 prompt 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.
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