IELinkClickByText ($oIE, "Continue")
会发出警告:
IE.au3 T3.0-1 Warning from function _IELinkClickByText, $_IEStatus_NoMatch
_IEAction ($oSubmit, "click")
会抛出错误:
_IEAction(click), $_IEStatus_InvalidDataType
类似地,许多IE函数(_IEPropertySet
,_IEGetObjById
)在IE10中失败,即使这些函数在IE9中有效。
有人能建议解决这个问题的解决方案吗?
答案 0 :(得分:0)
在运行代码之前尝试为IE启用兼容模式。
$64Bit = ""
If @OSArch = "X64" Then
$64Bit = "64"
EndIf
If StringLeft(RegRead("HKLM" & $64Bit & "\SOFTWARE\Microsoft\Internet Explorer\Version Vector", "IE"), 1) > 8 Then ;Check for version 9 or later
$wshNetwork = ObjCreate("WScript.Network")
$struser = $wshNetwork.Username
$objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
$objAccount = $objWMIService.Get('Win32_UserAccount.Name="' & $struser & '",Domain="' & @ComputerName & '"')
RegWrite("HKU" & $64Bit & "\" & $objAccount.SID & "\Software\Microsoft\Internet Explorer\BrowserEmulation\", "AllSitesCompatibilityMode", "REG_DWORD", 1)
RegWrite("HKU\" & $objAccount.SID & "\Software\Microsoft\Internet Explorer\BrowserEmulation\", "AllSitesCompatibilityMode", "REG_DWORD", 1)
EndIf