Jump to content

IE question


AceLoc
 Share

Recommended Posts

#include <IE.au3>

$sUsername = "MY ACCOUNTNAME"
$sPassword = "MY PASSWORD"
$sUrl = "http://forums.d2jsp.org/index.php?act=Login&CODE=00"
$oIE = _IECreate ($sUrl)
$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)

only the Submit thingy dont work :P

Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

  • Moderators

This has been a common occurrence lately. Dale may be able to provide an explanation, but here is a workaround.

#include <IE.au3>

$sUsername = "MY ACCOUNTNAME"
$sPassword = "MY PASSWORD"
$sUrl = "http://forums.d2jsp.org/index.php?act=Login&CODE=00"
$oIE = _IECreate($sUrl, 0, 1, 0)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
_IELoadWait($oIE)
$oForm = _IEFormGetObjByName($oIE, "LOGIN")
$oUsername = _IEFormElementGetObjByName($oForm, "UserName")
$oPassword = _IEFormElementGetObjByName($oForm, "PassWord")
$oSubmit = _IEFormElementGetObjByName($oForm, "submit")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEAction($oSubmit, "click")
Link to comment
Share on other sites

This has been a common occurrence lately. Dale may be able to provide an explanation, but here is a workaround.

#include <IE.au3>

$sUsername = "MY ACCOUNTNAME"
$sPassword = "MY PASSWORD"
$sUrl = "http://forums.d2jsp.org/index.php?act=Login&CODE=00"
$oIE = _IECreate($sUrl, 0, 1, 0)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
_IELoadWait($oIE)
$oForm = _IEFormGetObjByName($oIE, "LOGIN")
$oUsername = _IEFormElementGetObjByName($oForm, "UserName")
$oPassword = _IEFormElementGetObjByName($oForm, "PassWord")
$oSubmit = _IEFormElementGetObjByName($oForm, "submit")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEAction($oSubmit, "click")
awhh oke thanks alot.

i will take a look on it to understand what you've changed and for what :P

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

awhh oke thanks alot.

i will take a look on it to understand what you've changed and for what :P

From the help for _IEFormSubmit:

Remarks

For many HTML forms it is not sufficient to use _IEFormSubmit() because there is often custom Javascript tied to an onclick event for its Submit button. In these cases you'll need to simulate a click of the submit button instead of using _IEFormSubmit(). See the example for the "click" action of _IEAction().

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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