dvlkn Posted July 3, 2008 Share Posted July 3, 2008 HelloI wanted to use this code to auto login into that web page (starkingdoms.com) but I cannot find the form name nor the button name.#include <IE.au3> $sUsername = "username" $sPassword = "password" $sURL = "http://starkingdoms.com" $oIE = _IECreate($sURL) $oForm = _IEFormGetObjByName($oIE, "no form name!") $oUsername = _IEFormElementGetObjByName($oForm, "account") $oPassword = _IEFormElementGetObjByName($oForm, "password") $oButton = _IEGetObjByName($oForm, "no button name!") _IEFormElementSetValue($oUsername, $sUsername) _IEFormElementSetValue($oPassword, $sPassword) _IEAction($oButton, "click")So how can I do this ? If there is an alternative way, please tell me: I am trying to learn programming in autoIT Link to comment Share on other sites More sharing options...
someone Posted July 3, 2008 Share Posted July 3, 2008 I can't check out the website, but for the form try IEFormGetCollection, and for the button try IELinkClickByIndex, or IEFormSubmit (obviously need reference to the form first). Or if the button has an id I believe you can reference it IEGetObjById While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
newbiescripter Posted July 3, 2008 Share Posted July 3, 2008 (edited) Hello I wanted to use this code to auto login into that web page (starkingdoms.com) but I cannot find the form name nor the button name. #include <IE.au3> $sUsername = "username" $sPassword = "password" $sURL = "http://starkingdoms.com" $oIE = _IECreate($sURL) $oForm = _IEFormGetObjByName($oIE, "no form name!") $oUsername = _IEFormElementGetObjByName($oForm, "account") $oPassword = _IEFormElementGetObjByName($oForm, "password") $oButton = _IEGetObjByName($oForm, "no button name!") _IEFormElementSetValue($oUsername, $sUsername) _IEFormElementSetValue($oPassword, $sPassword) _IEAction($oButton, "click") So how can I do this ? If there is an alternative way, please tell me: I am trying to learn programming in autoIT Here is how you can do: #include <IE.au3> $oIE = _IECreate("http://starkingdoms.com/") $oForm = _IEFormGetCollection ($oIE, 0) $oAccount = _IEFormElementGetCollection ($oForm, 0) $oPass = _IEFormElementGetCollection ($oForm, 1) _IEFormElementSetValue ($oAccount,"Username") _IEFormElementSetValue ($oPass,"Password") _IEFormSubmit ($oForm,0) _IELoadWait($oIE) MsgBox(0,"Done","The job is done") Regards Edited July 3, 2008 by newbiescripter Link to comment Share on other sites More sharing options...
dvlkn Posted July 3, 2008 Author Share Posted July 3, 2008 I was just about to post back in here about some problem but your code solved it muttley thanks! Link to comment Share on other sites More sharing options...
msarocks Posted April 22, 2009 Share Posted April 22, 2009 Does this script work for https:// sites as well? Thanks. Here is how you can do: #include <IE.au3> $oIE = _IECreate("http://starkingdoms.com/") $oForm = _IEFormGetCollection ($oIE, 0) $oAccount = _IEFormElementGetCollection ($oForm, 0) $oPass = _IEFormElementGetCollection ($oForm, 1) _IEFormElementSetValue ($oAccount,"Username") _IEFormElementSetValue ($oPass,"Password") _IEFormSubmit ($oForm,0) _IELoadWait($oIE) MsgBox(0,"Done","The job is done") Regards 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