Sign in to follow this  
Followers 0
pileot

Inputting data into web forms without a form name... With frames

8 posts in this topic

#1 ·  Posted (edited)

Ok original issue got fixed with some tweaking, but now im trying to apply working with IE forms on pages that have frames. How do i specify what frame to use?

Edited by pileot

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Strange, it will type everything in, and acts like it clicks "Enter lol!" as it should, but then it goes to the main screen again...

#include <IE.au3>
$username = "******"
$password = "*******"

$oIE = _IECreate ("http://www.lordsoflords.com/meadow2/login.php")
_IELoadWait ($oIE)

$oForm = _IEFormGetCollection ($oIE, 1)
$oUsername = _IEFormElementGetObjByName ($oForm, "UserName")
$oPassword = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oUsername, $username)
_IEFormElementSetValue ($oPassword, $password)
sleep(3000)
$oLogIn = _IEGetObjByName($oIE, "Action")
_IEAction($oLogIn, "click")
_IELoadWait($oIE)

if i click enter before the auto click kicks in, i can log in, otherwise it doesnt work... ideas?

Edited by pileot

Share this post


Link to post
Share on other sites

KeeForm is a great program to login to websites....have a check with the PassSecure topic...it has a KeeForm login bot...you can set a script to run it...with the acct pw...and website...and it does the rest.

Share this post


Link to post
Share on other sites

Strange, it will type everything in, and acts like it clicks "Enter lol!" as it should, but then it goes to the main screen again...

#include <IE.au3>
$username = "******"
$password = "*******"

$oIE = _IECreate ("http://www.lordsoflords.com/meadow2/login.php")
_IELoadWait ($oIE)

$oForm = _IEFormGetCollection ($oIE, 1)
$oUsername = _IEFormElementGetObjByName ($oForm, "UserName")
$oPassword = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oUsername, $username)
_IEFormElementSetValue ($oPassword, $password)
sleep(3000)
$oLogIn = _IEGetObjByName($oIE, "Action")
_IEAction($oLogIn, "click")
_IELoadWait($oIE)

if i click enter before the auto click kicks in, i can log in, otherwise it doesnt work... ideas?

Cute... there are two forms on that page and each has Username, Password and Action elements. You are entering username and password into form 1 and you are clicking the Action button in form 0 (since it is listed first).

Several ways to tackle this... one is $oLogIn = _IEFormElementGetObjByName($oForm, "Action")

Dale

P.S. DebugBar made figuring this out very simple


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

Cute... there are two forms on that page and each has Username, Password and Action elements. You are entering username and password into form 1 and you are clicking the Action button in form 0 (since it is listed first).

Several ways to tackle this... one is $oLogIn = _IEFormElementGetObjByName($oForm, "Action")

Dale

P.S. DebugBar made figuring this out very simple

In writting my response i used the amazing tool, DebugBar,

Didnt notice the forms you stated. That was a over sight on my part while trying to help him.

Share this post


Link to post
Share on other sites

In writting my response i used the amazing tool, DebugBar,

Didnt notice the forms you stated. That was a over sight on my part while trying to help him.

No problem - I didn't see it right away either. When I realized it wasn't making sense I looked at the section on the left -- we usually focus on the Document section, but there are alos sections for Links, Images, Forms, Scripts and Style Sheets.

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

No problem - I didn't see it right away either. When I realized it wasn't making sense I looked at the section on the left -- we usually focus on the Document section, but there are alos sections for Links, Images, Forms, Scripts and Style Sheets.

Dale

AHH, didnt even check the script i just wrote it with out testing it or i prob would have ben fustrated and figured it out lol.

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  
Followers 0