chachew Posted October 2, 2011 Share Posted October 2, 2011 I have been trying to get this to work for hours now but i must be missing something. I am reading the source from IE to get a version number. I can successfully read and then use _IEPropertySet to overwrite the onpage html, so i know im getting the script to read the source and sucessfully overwrite it. The problem is im trying to write some error checking statements to only run code if the version number is different than previously captured, but if i try to do a consolewrite or msgbox to display the read text the only response i get back is '0' #include <IE.au3> $oIE=_IEAttach("mysite.com") $versionName="my test version #" $Page=_IEFormGetObjByName($oIE, "form1") WinWait("My Site") $versionNum = _IEGetObjById($Page, "lblVersion") $versionGet = _IEPropertyGet($versionNum, "innertext") MsgBox(1,"",_IEPropertyGet($versionNum, "innertext")) _IEPropertySet($versionNum, "innertext", $versionName) Ive tried every variation of ways that i can think to show the _IEPropertyGet($versionNum, "innertext") in console or msgbox but must be lacking something... I also keep getting errors in the console that im not sure what is causing them --> IE.au3 V2.4-0 Error from function _IEGetObById, $_IEStatus_InvalidObjectType --> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType Link to comment Share on other sites More sharing options...
DaleHohm Posted October 2, 2011 Share Posted October 2, 2011 You'll get nowhere without understanding the casuse of the messages to the console. Start with he first one. It means that the parameter you passed to _IEGetObByID is an objet, but not the expected type of object. Go look at the documentation for that function and the type of object expected intaht frst parameter andsee if itmakes sense to you now. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
chachew Posted October 2, 2011 Author Share Posted October 2, 2011 Ive read through the helpfile on all of these parameters but its seems like i may be not understanding something....the helpfile states nothing about what type of objects are expected or anything that i can see... Returns an object variable by id or name.#include <IE.au3>_IEGetObjById ( ByRef $o_object, $s_Id) Parameters $o_object Object variable of an InternetExplorer.Application, Window or Frame object $s_Id Specifies id or name of the object you wish to match Return Value Success: Returns an object variable pointing to the specified Object Failure: Returns 0 and sets @ERROR @Error: 0 ($_IEStatus_Success) = No Error 3 ($_IEStatus_InvalidDataType) = Invalid Data Type 7 ($_IEStatus_NoMatch) = No Match RemarksThis function will return an object reference to any object in the document with a specified id or name. DOM elements can have Name or ID attributes or both. A specific ID can be assigned to only a single element while a specific Name can be assigned to multiple elements. In Internet Explorer, the Name and ID namespaces are shared. 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