Jump to content

Recommended Posts

Posted

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 ?

Posted

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")

Posted (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 by miragee
Posted

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)
Posted (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 by miragee
Posted

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 ? 

Posted (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 by miragee
Posted

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 ?

Posted

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
happy.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...