CaptainBeardsEyesBeard Posted January 10, 2020 Share Posted January 10, 2020 (edited) Hi I feel like I'm going mad as some of my old scripts aren't working so trying to return back to basics and fix them. I want to be able to pull data out of a box on IE for example and would like you to let me know if I'm doing it correctly.. So this is my html and it's just an text box (editable) Quote <div class="row"> <div class="col-md-8"> <label class="label">Title</label> <input name="title" class="form-control valid" id="title" aria-invalid="false" aria-required="true" required="" type="text" maxlength="200" value="Mr Captain Birdseye v Cpt Blackbeard"> </div> So I just have this small snippet If WinActivate("Test app - Internet Explorer") Then WinSetState("Test app - Internet Explorer", "", @SW_MAXIMIZE) Sleep(4000) Else EndIf $oIE = _IEAttach("Test app - Internet Explorer") Sleep(4000) _IELoadWait($oIE) $Test = _IEGetObjById($oIE, "title") if @error then MsgBox($MB_SYSTEMMODAL, "Error handling" , "Error pulling attempting $Test = _IEGetObjById($oIE, 'submitDiv') " , 4) Endif MsgBox($MB_SYSTEMMODAL, "blah" , $Test.value, 4) MsgBox($MB_SYSTEMMODAL, "blah" , $Test.innerText, 4) exit And I get a following console output saying it must be of type Object It also hits the @error check and produces the message box in the If statement >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Automation_Solcase\testdelete.au3" --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-2 Error from function _IEGetObjById, $_IESTATUS_InvalidDataType "C:\Automation_Solcase\testdelete.au3" (50) : ==> Variable must be of type "Object".: MsgBox($MB_SYSTEMMODAL, "blah" , $Test.value, 4) MsgBox($MB_SYSTEMMODAL, "blah" , $Test^ ERROR >Exit code: 1 Time: 13.21 Edited January 10, 2020 by CaptainBeardsEyesBeard Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 10, 2020 Share Posted January 10, 2020 @CaptainBeardsEyesBeard The variable $oIE is not an object, and so, every other function which is trying to access an object, fails, and so, you have those errors. Check the function _IEAttach(), and check if ir correctly returns an object with IsObj() function Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Nine Posted January 10, 2020 Share Posted January 10, 2020 Even more checking at the very beginning : Local $hWnd = WinGetHandle ("Test app - Internet Explorer") if not $hWnd then Exit MsgBox (0,"","Unable to find window") Local $oIE = _IEAttach ($hWnd, "hwnd") if not isObj ($oIE) then Exit MsgBox (0,"","Not an object") “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted January 20, 2020 Author Share Posted January 20, 2020 On 1/10/2020 at 10:15 AM, FrancescoDiMuro said: @CaptainBeardsEyesBeard The variable $oIE is not an object, and so, every other function which is trying to access an object, fails, and so, you have those errors. Check the function _IEAttach(), and check if ir correctly returns an object with IsObj() function Oh man that's what I was missing! I had thought if you used IECREATE you wouldn't need IEATTACH Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 20, 2020 Share Posted January 20, 2020 @CaptainBeardsEyesBeard Glad I could help Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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