AndreasVliegen Posted March 29, 2006 Posted March 29, 2006 (edited) Hello people, I created this program that sends an Username and a Password from an INI-file to a Webpage $user = IniRead($installdir & "\Files\Inloggen.ini","Account","User","") $pass = IniRead($installdir & "\Files\Inloggen.ini","Account","Pass","") $browser = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "") Run('"' & $browser & '"' & "http://teletop.bc-enschede.nl/02start.nsf?Login&lan=NL&RedirectTo=/02start.nsf") WinWaitActive("TeleTOP Login -") Send($user) Send("{TAB}") Send($pass) Send("{ENTER}") Sort of an automatic login script, but sometimes the $user and the $pass are typed into the URL bar, so how can I check if the cursor is at the input box on the website? Part of HTML code of the web page: <input name="UsernameInput" value="" class="inp" maxlength=256> <input name="Username" value="" type=hidden></td> <input name="Password" value="" type="password" class="inp" maxlength=256> Cheers, SteeloXP Edited March 29, 2006 by AndreasVliegen
seandisanti Posted March 29, 2006 Posted March 29, 2006 Hello people, I created this program that sends an Username and a Password from an INI-file to a Webpage $user = IniRead($installdir & "\Files\Inloggen.ini","Account","User","") $pass = IniRead($installdir & "\Files\Inloggen.ini","Account","Pass","") $browser = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "") Run('"' & $browser & '"' & "http://teletop.bc-enschede.nl/02start.nsf?Login&lan=NL&RedirectTo=/02start.nsf") WinWaitActive("TeleTOP Login -") Send($user) Send("{TAB}") Send($pass) Send("{ENTER}") Sort of an automatic login script, but sometimes the $user and the $pass are typed into the URL bar, so how can I check if the cursor is at the input box on the website? Part of HTML code of the web page: <input name="UsernameInput" value="" class="inp" maxlength=256> <input name="Username" value="" type=hidden></td> <input name="Password" value="" type="password" class="inp" maxlength=256> <input name="RedirectTo" value="/02start.nsf" type=hidden></td> Cheers, SteeloXPif you're using internet explorer, you should check out dale's IE.au3 it will allow you to set the text for the form elements exactly where they should go, just like using a controlsettext with a non browser window.
Jynxst Posted March 29, 2006 Posted March 29, 2006 Sounds like the login window might be losing focus for some reason... try this: WinWait("TeleTOP Login -") Sleep(500) WinActivate("TeleTOP Login -") Send($user) Send("{TAB}") Send($pass) Send("{ENTER}") The sleep statement might not be necessary - I just added it there to give a buffer between the window appearing and beginning to input to it. You could instead use Opt("WinWaitDelay", 500) if you like this method better.
AndreasVliegen Posted March 29, 2006 Author Posted March 29, 2006 (edited) if you're using internet explorer, you should check out dale's IE.au3 it will allow you to set the text for the form elements exactly where they should go, just like using a controlsettext with a non browser window.Thanks, I think I found this *huge* script / program http://www.autoitscript.com/forum/index.ph...13398&hl=IE.au3I'm checking which function I need to use If I don't understand, I'll reply here Thanks and cheers,SteeloXP Edited March 29, 2006 by AndreasVliegen
seandisanti Posted March 29, 2006 Posted March 29, 2006 It all works fine! Thanks again! glad you figured it out. we're always happy to help.
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