Recently Browsing 0 members
No registered users viewing this page.
I've tried to create a script to browse to a web page in IE, but it only works for some sites, I've tried to simplify the script as much as possible, hoping you can point me in the right direction - thanks.
This one going to Google does work:
#include <IE.au3> $oIE = _IECreate("https://www.google.com.au/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) But this one going to OneDrive opens the IE page, but fails immediately returning the errors, and the IE window is not closed:
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType ()
--> IE.au3 T3.0-2 Error from function _IEQuit, $_IESTATUS_InvalidObjectType
#include <IE.au3> $oIE = _IECreate("https://abccorp-my.sharepoint.com/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) Even if I put a sleep timer in for 10 seconds after the _IECreate it still doesn't work
I have kept below line to wait for IE to load the site completely and continue.
But, the code is continuing without waiting for it and I my execution is failing as the elements are not loaded completely.
Any suggestions for alternate code to wait for the browser to load completely?
I have this simple script which automates google translate.
#include <IE.au3> $oIE = _IECreate("http://translate.google.com/#en|fr|") $oForm = _IEFormGetObjByName($oIE, "text_form") $oText = _IEFormElementGetObjByName($oForm, "text") _IEFormElementSetValue($oText, "Hello") Sleep(3000) $id = _IEGetObjById($oIE, "result_box") $oText1 = _IEPropertyGet($id, "innertext") MsgBox(0,"Translate",$oText1)
What i want to do it to remove the Sleep(3000) that there is in the script. But removing it the script doesnt works because the message box appears before geting the value of the innertext....
Is there a way to remove or replace the sleep time??? I tried _IELoadWait() but it doesnt work.
Edit: Testing for the $oText1.value just add some more pointless lines to the script and leeds at adding sleep seconds until value is true...
Can't resolve a problem with killing needed attached tabs, always is killed 3 from 5.
Here is 6 links, 5 need to be killed:
#include <IE.au3> #include <String.au3> $oIE = _IECreate('facebook.com') __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) sleep(5000) Dim $aIE Dim $aRE $aIE = 0 $aRE = 0 $i = 1 While 1 $oIE = _IEAttach ("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] ReDim $aRE[$i + 1] $aIE[$i] = $oIE $get = _IEPropertyGet($oIE, "locationurl") $aRE[$i] = $get $aIE = $i $check = _StringBetween($get, "m.", ".com") If not @error then $oIE = _IEAttach ("", "instance", $i) ConsoleWrite('Get = '&$get&@CRLF) _IEQuit($oIE) sleep(200) EndIf $i += 1 WEnd MsgBox(0, "Browsers Found", "Number of browser instances in the array: " & $aIE)
Thank you in advance.