stupidngai Posted January 16, 2009 Share Posted January 16, 2009 I used DebugBar to find the infomation of the field in website:<INPUT id=standardPeriodChooserPrompt_toDate onchange=' htmlInputs_onchangeUpdateNode( genericXSLTCallerRenderer3Renderer.model, "/*/To", this.value, "","",true, this ); reValidateData();' value=2009-01-01 bcdMandatory="false" bcdBaseClass="editFormTextField" bcdDataType="date">I found that no name for this field! How can I use _IEFormElementGetObjByName($o_form, "name")??I try to use id as name but fail.Since it is the company internal web system, so it is useless to post the website as you cannot access to it...Hope somebody can help. Link to comment Share on other sites More sharing options...
BrettF Posted January 16, 2009 Share Posted January 16, 2009 Hi, Welcome to the forums! I would try something like so: #include <IE.au3> $oIE = _IECreate ("http://www.google.com") $oForm = _IEFormGetCollection ($oIE, 0) $oQuery = _IEGetObjById($oIE, "q"); 2nd Param = Name/ID _IEFormElementSetValue ($oQuery, "AutoIt IE.au3") _IEFormSubmit ($oForm) It's always good to post your code, etc. to show what you've tried- it makes it easier for us, and who knows, you might be very close! Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
DaleHohm Posted January 17, 2009 Share Posted January 17, 2009 Please read the remarks section in the helpfile for _IEFormElementGetObjByName 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...
TerarinK Posted January 17, 2009 Share Posted January 17, 2009 It does have a name<INPUT id=standardPeriodChooserPrompt_toDate onchange=' htmlInputs_onchangeUpdateNode( genericXSLTCallerRenderer3Renderer.model, "/*/To", this.value, "","",true, this ); reValidateData();' value=2009-01-01 bcdMandatory="false" bcdBaseClass="editFormTextField" bcdDataType="date">There is however another way to retrieve this information by going through _IETagNameGetCollection and following the example in the help file there 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 17, 2009 Share Posted January 17, 2009 It does have a name<INPUT id=standardPeriodChooserPrompt_toDate onchange=' htmlInputs_onchangeUpdateNode( genericXSLTCallerRenderer3Renderer.model, "/*/To", this.value, "","",true, this ); reValidateData();' value=2009-01-01 bcdMandatory="false" bcdBaseClass="editFormTextField" bcdDataType="date">There is however another way to retrieve this information by going through _IETagNameGetCollection and following the example in the help file thereNote that .id and .name are different properties. So no, this does not have a name, but it does have a useful id. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted January 18, 2009 Share Posted January 18, 2009 Almost... In fact the DOM does something unexpected here and the a Name will match either a name= or id= attribute. On the other hand, ID will only match id= 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...
stupidngai Posted January 19, 2009 Author Share Posted January 19, 2009 Please read the remarks section in the helpfile for _IEFormElementGetObjByNameI read the Help and see the remarks...RemarksIf the desired form element does not have a name or ID, _IEFormElementGetCollection to get a reference by indexIn fact I don't understand how to get a reference by index... is it a number like 0, 1, 2, 3?? But I try it and get nothing eventually...Here is my code:$oIE2 = _IENavigate($oIE, $MIP_OB_TT)Sleep(10000)$o_form2 = _IEFormGetCollection($oIE2)$o_from = _IEFormElementGetObjByName($o_form2, 0)$o_to = _IEFormElementGetObjByName($o_form2, 1)_IEFormElementSetValue($o_from, "2009-01-01")_IEFormElementSetValue($o_to, "2009-01-04") Link to comment Share on other sites More sharing options...
DaleHohm Posted January 19, 2009 Share Posted January 19, 2009 Are you running your code in SciTe? If not, you are missing a lot. In particular, taht code should be returning helpful warning and error messages to the console -- please don't ignore them. 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...
PsaltyDS Posted January 19, 2009 Share Posted January 19, 2009 Almost...In fact the DOM does something unexpected here and the a Name will match either a name= or id= attribute. On the other hand, ID will only match id=DaleHuh. Learn something new every day... and I'm done for today! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
LubeLee Posted January 22, 2009 Share Posted January 22, 2009 Huh. Learn something new every day... and I'm done for today! This question is still unsolvedWhat is the matter, bros?Why don't we have try "_IEGetObjById"? - This is not optimal but usable, right?OR think of Dale suggest (remarks of "_IEFormGetCollection")Here:*/ no ID or Name needed to identify form/element but its order of appearance in the returned HTML page (and this order is something we always have)#include <IE.au3>$oIE = _IECreate ("http://www.google.com")$oForm = _IEFormGetCollection ($oIE, 0) ; I realize my desired form is the 1st form (forms/elements order starts with 0)$oQuery = _IEFormElementGetCollection ($oForm, 1) ; similarly, I realize my desired form element is the 2st element of the form $oForm_IEFormElementSetValue ($oQuery, "AutoIt IE.au3") ; no care, this is the problem of identification_IEFormSubmit ($oForm) ; no care, this is the problem of identificationOR make an improve to IE.au3 add to it the accompany of "_IEFormGetObjByName" - "_IEFormGetObjById"For this, we need help of the author of IE.au3 Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2009 Share Posted January 22, 2009 The point was that the name function will match either name or id. Did you try something like this? $oQuery = _IEFormElementGetObjByName($oForm, "standardPeriodChooserPrompt_toDate") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted January 22, 2009 Share Posted January 22, 2009 And the point was also to use _IEFormGetCollection (that is what the Remarks tell you about) #include <IE.au3> $oIE = _IECreate("www.google.com") $oForms = _IEFormGetCollection($oIE) ConsoleWrite("Forms found on page: " & @extended & $CRLF) For $oForm in $oForms ConsoleWrite(_IEPropertyGet($oForm, "outerhtml" & @CRLF & "-----------------" & @CRLF) Next 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...
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