Jump to content
Sign in to follow this  
Tokie

web login

Recommended Posts

Tokie

k im tring to get it to sumit my username and password here and ive tried a few things and when i have searched it points me to this so tell me if this working so im doing something wrong

heres me code

well someone elses i cant get it to work

#include <IE.au3>
Global $hWindow, $stRET, $sMsg, $pStruct, $iRET, $I = 1


;ShellExecute ("iexplore.exe", "deleated")
;WinWait ("Blank Page")
$sUsername = "tokie_"
$sPassword = "123456"
$sUrl = "anyurl"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'Username')
$oPassword = _IEFormElementGetObjByName($oForm, "Password")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

stil not giving away my website but still i want some help and heres the source code clipit f my login it boxes

><table cellpadding="0" cellspacing="0" width="100%" style="height:200px;"><tr><td><table cellpadding="0" cellspacing="0" class="f_table" align="center"><form method="post" action="/login.php">
    <tr class="f_title"><td colspan="2"><img src="removed" align="absmiddle" /> Account Login</td></tr>
    <tr><td colspan="2"><em>Registered users log in here.</em></td></tr>
    <tr><td colspan="2" height="10"></td></tr>
    <tr><td>Username</td><td><input type="text" class="inputtext" name="username" style="width:200px;" maxlength="20" value="tokie_" /></td></tr>
    <tr><td>Password</td><td><input type="password" class="inputtext" name="password" style="width:200px;" maxlength="20" /></td></tr><tr><td colspan="2" height="10"></td></tr>
    <tr><td colspan="2" align="right" style="border-top:2px solid #EABA00; padding:4px;"><input type="submit" value="Login" style="height:20px;font-size:10px;" /></td></tr>
    <input type="hidden" name="action" value="login" /></form></table>

some help please

Edited by Tokie

Share this post


Link to post
Share on other sites
Tvern

You should probably add _IEErrorHandlerRegister and check what errors you are getting. I suspect one out of two common errors:

1.

Element not found errors from _IEFormElementGetObjByName, which would mean you're looking in the wrong form.

Solution would be to check the instance of the right form, or make the script loop through all forms and check for the correct inputs to be present.

2.

Nothing returns an error, and data is being inserted into the inputs, but the form does not submit.

Solution would be to use _IEAction($oIE,"click") on the button element.

Without more data it will stay guesswork.

ps. I don't see the use of the shellexecute in your script.

Share this post


Link to post
Share on other sites
DaleHohm

IE.au3 works hard to give you helpful messages in the SciTe console... what is written there? You'll also need to explain what is not working as expected. As Tvern says, "Without more data it will stay guesswork" and you'll find that most people here will not do guess work.

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

Share this post


Link to post
Share on other sites
jfcby

If your username and password is not being inserted into the form inputs it appears that you have them spelled wrong. Make sure that the HTML source form input name is spelled with lower and upper case letters.

Change from this:

$oUsername = _IEFormElementGetObjByName($oForm, 'Username')
$oPassword = _IEFormElementGetObjByName($oForm, "Password")

to this:

$oUsername = _IEFormElementGetObjByName($oForm, "username")
$oPassword = _IEFormElementGetObjByName($oForm, "password")

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites
Tokie

sorry guys im really not tring to play the gussing game at all here i did re read the source again and relize that for some reason their was a hidden fourm on the page so my index was wrong i guess i shouldnt have used a website builder and just coded it myself lol ... i got automated thanks guys i know yall didnt really give me the source i like it that way but you did make me relize i was forgetting the error handle and that pointed to what i needed thanks

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.