Command3r Posted August 23, 2013 Share Posted August 23, 2013 hello, i have problem that the website i want to fill forms in it has no object name or id in google there's _IEFormGetObjByName($oIE, "f") ; the obj name is "f" _IEFormElementGetObjByName($oForm, "q") ; and the form is "q" in website i want, there's no the fObjName PART. what should i do? the source of the forms </div> <div id="rightcontent"> <div class="box_one"> <div class="box_one_title">User panel</div> <form action="/" method="post"> <table border='1' cellpadding='0' cellspacing='0'> <form method='post' action='index.php'> <input placeholder='Username' name='username' autocomplete='off' class='login_input' type='text'><br> <input placeholder='Password' name='password' autocomplete='off' class='login_input' style='margin-top: -1px;' type='password'><br> <input value='login' name='submit' class='loginbtnwidth' style='width:100%;margin-top: 4px;' type='submit'><br> </form> </table> <br /> <center> <a href='?pg=reg' class='button small green'> Register Now ! </a><a href='?pg=forgotpw' class='button small gray'>Forgot Password ?</a> </center> </div> any help would be appreciated, thanks. [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
DaleHohm Posted August 23, 2013 Share Posted August 23, 2013 Read the helpfile - see the remarks section of the two _IE functions you mention. 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...
Command3r Posted August 23, 2013 Author Share Posted August 23, 2013 @Dale i tried that but didn't work :S #include <IE.au3> Local $oIE = _IECreate("www.thewebsite.com", "1") _IELoadWait($oIE) $oForm = _IEFormElementGetCollection($oIE, 0) _IEFormElementSetValue($oForm, "testttt") [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
Command3r Posted August 23, 2013 Author Share Posted August 23, 2013 Any help?? [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
EKY32 Posted August 23, 2013 Share Posted August 23, 2013 Well, I'm sorry not to have time to test but try to use_IEFormGetCollection which returns an object variable with a collection of all forms in the document. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Command3r Posted August 23, 2013 Author Share Posted August 23, 2013 @EKY32 notworking also :/ [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
Gianni Posted August 23, 2013 Share Posted August 23, 2013 first step find all forms in the page with $Forms = _IEFormGetCollection($oIE) read the @extended value to see how many forms are there if there is only one form then you can point to that by indexing 0 $MyTargetForm = _IEFormGetCollection($oIE, 0) if there are more forms, than you have to increment the index (0) till you point to your targhet form EKY32 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Command3r Posted August 23, 2013 Author Share Posted August 23, 2013 tired of trying, it seems there's one form, but actually there's 2 here's the site and i hope i didnt break the rules http://sj-sro.zapto.org/ [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
Solution DW1 Posted August 23, 2013 Solution Share Posted August 23, 2013 #include <IE.au3> Local $oIE = _IECreate("http://sj-sro.zapto.org/") $oForm = _IEFormGetCollection($oIE, 0) $oUser = _IEFormElementGetObjByName($oForm, 'username') $oPass = _IEFormElementGetObjByName($oForm, 'password') _IEFormElementSetValue($oUser, "username") _IEFormElementSetValue($oPass, "password") You were using _IEFormElementGetCollection when you should have been using _IEFormGetCollection to get the form, then you were trying to set the form to text which isn't going to work because you need to get the element first. Command3r and EKY32 2 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Command3r Posted August 23, 2013 Author Share Posted August 23, 2013 #include <IE.au3> Local $oIE = _IECreate("http://sj-sro.zapto.org/") $oForm = _IEFormGetCollection($oIE, 0) $oUser = _IEFormElementGetObjByName($oForm, 'username') $oPass = _IEFormElementGetObjByName($oForm, 'password') _IEFormElementSetValue($oUser, "username") _IEFormElementSetValue($oPass, "password") You were using _IEFormElementGetCollection when you should have been using _IEFormGetCollection to get the form, then you were trying to set the form to text which isn't going to work because you need to get the element first. Many thanks <3 [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] 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