miragee Posted March 12, 2015 Share Posted March 12, 2015 Hi guys, I'm trying to login into a website but i cannot seem to find a way to "click" into the login button. I can submit the info (user and password) but cannot click on the button html code <input type="submit" value="Login" class="submit"> Any help ? Link to comment Share on other sites More sharing options...
jguinch Posted March 12, 2015 Share Posted March 12, 2015 Please, post your code... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
miragee Posted March 12, 2015 Author Share Posted March 12, 2015 Func Login () Global $oIE = _IECreate ("link_to_the_page") Local $username = _IEGetObjByName ($oIE ,"membername") Local $password = _IEGetObjByName ($oIE ,"password") Local $btn_login = _IEFormElementSetValue ($username, "user") _IEFormElementSetValue ($password, "password") _IEAction($btn_login, "click") EndFunc Call ("Login") Link to comment Share on other sites More sharing options...
jguinch Posted March 12, 2015 Share Posted March 12, 2015 Without more html code, it's difficult... Try to work with _IEFormGetCollection or use the form name with _IEGetObjByName, and then try $oForm.Submit() Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
miragee Posted March 12, 2015 Author Share Posted March 12, 2015 (edited) <div id="loginbox"> <form id="loginbox_form" action=""> <p> <label for="membername">Utilizador</label><br> <input type="text" name="membername" id="membername" class="s" accesskey="m" value=""> </p> <p> <label for="loginbox_password">Password</label><br> <input type="password" name="password" id="password" class="s" accesskey="p" value=""> </p> <p id="loginbox-buttons"> <input type="submit" value="Login" class="submit"> <input type="reset" value="Limpar" class="submit"> </p> </form> </div> Can you give me an example ? Edited March 12, 2015 by miragee Link to comment Share on other sites More sharing options...
jguinch Posted March 12, 2015 Share Posted March 12, 2015 Try this : $oForm = _IEGetObjById($oIE, "loginbox_form") $oForm.submit() Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
tweakster2010 Posted March 12, 2015 Share Posted March 12, 2015 try this, this is what I use for most of the websites I use to login automatically for work. Local $oIETEST = _IECreate("https.test.com") Local $oFormTEST = _IEGetObjById($oIETEST, "loginForm") Local $oFormTESTU = _IEGetObjById($oIETEST, "name") _IEFormElementSetValue($oFormTESTU, "Username") Local $oFormTESTP = _IEGetObjById ($oIETEST, "password") _IEFormElementSetValue($oFormTESTP, "password") _IEFormSubmit ($oFormTest) Link to comment Share on other sites More sharing options...
Danp2 Posted March 12, 2015 Share Posted March 12, 2015 Did you try _IEFormGetObjByName along with _IESubmit? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
miragee Posted March 12, 2015 Author Share Posted March 12, 2015 (edited) Got it working, thanks One more question, it's possible to save cookies into a file and then use that file to login into a website ? Edited March 12, 2015 by miragee Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 Besides the cookies "problem", how i can selec an value on a select dropdown in html ? Link to comment Share on other sites More sharing options...
jguinch Posted March 13, 2015 Share Posted March 13, 2015 In the helpfile, there is a function do to exactly what you wan.... https://www.autoitscript.com/autoit3/docs/libfunctions/IE%20Management.htm Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 Thanks, solved it, now i've another problem. I'm trying to upload an file and i need to insert some description and I've an iframe with tinymce javascript, how i can add text to it ? Link to comment Share on other sites More sharing options...
jguinch Posted March 13, 2015 Share Posted March 13, 2015 Again, without the webpage source, how do you expect us to help you? For my part, I cannot spend all my time to ask you the html and AutoIt code... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) Sorry jguinch Html Code: <iframe id="tinymce_autoload_ifr" src='javascript:""' frameborder="0" allowtransparency="true" title="{#aria.rich_text_area}" style="width: 100%; height: 135px; display: block;"> <body id="tinymce" class="mceContentBody " onload="window.parent.tinyMCE.get('tinymce_autoload').onLoad.dispatch();" contenteditable="true" dir="ltr" hola-ext-player="1"><br data-mce-bogus="1"></body> </iframe> Autoit Func Upload () Global $oIE = _IECreate("link") ;name Local $name = _IEGetObjByName($oIE ,"name") _IEFormElementSetValue($name, "test file") ;category $oForm = _IEFormGetCollection($oIE, 1) $oSelect = _IEFormElementGetObjByName($oForm, "id") _IEFormElementOptionSelect($oSelect, "55") ;description EndFunc Edited March 13, 2015 by miragee Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 jguinch could you try to help me out now ? Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 If i load the source code i cant see that iframe but if i use the google dev tools i can see it, could that be the reason ? Link to comment Share on other sites More sharing options...
miragee Posted March 13, 2015 Author Share Posted March 13, 2015 Anyone can help ? Link to comment Share on other sites More sharing options...
miragee Posted March 17, 2015 Author Share Posted March 17, 2015 Anyone? Link to comment Share on other sites More sharing options...
Kyan Posted March 18, 2015 Share Posted March 18, 2015 Hi miragee, the source code of a page and the source code of a page in execution is different if there're scripts running there...you just need to grab the source code of the running page through a webInspector (webrowsers have it) and post it here btw, the source you posted it doesn't match a submit form... Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better 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