Jump to content

_IEFormGetObjByName


Recommended Posts

I am trying to write a program that will enter my login details into the runescape pass change window but i cant seem to find the _IEFormGetObjByName and _IEFormElementGetObjByName values i believe the elements are just "username" and "password" but i cannot find the form obj name the html code is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:IE>
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title>RuneScape - the massive online adventure game by Jagex Ltd</title>
<link href="http://www.runescape.com/css/basic-1.css" rel="stylesheet" type="text/css" media="all">

<link href="http://www.runescape.com/css/extra-1.css" rel="stylesheet" type="text/css" media="all">
</head>
<body>

<div id="body">
<div style="text-align: center; background: none;">
<div class="titleframe e">
<b>Secure Login</b><br>
<a href="http://www.runescape.com/title.ws">Main Menu</a>
</div>
</div>
<br>
<div class="frame wide_e">
<table width="100%">
<tr>
<td align="center" colspan="3">
<div style="color:#FFBB22;">
<b>You need to log in to access this feature</b>
</div>
<br>
<div style="text-align:center">
Never enter your password anywhere except <b>RuneScape.com</b><br>
<img src="http://www.runescape.com/img/weblogin/onlyrs4.gif">
</div>
<form action="https://password_history.runescape.com/login.ws" method="post" autocomplete="off">
<table>
<tr>
<td>RuneScape username:</td>
<td><input size="20" type="text" name="username" maxlength="12"></td>
</tr>
<tr>
<td>RuneScape password:</td>
<td><input size="20" type="password" name="password" maxlength="20"></td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" value="Secure Login" style="background:#4D422E url('http://www.runescape.com/img/brownback.jpg'); color: white;" class="b"></td>
</tr>
</table>
<input type="hidden" name="dest" value="passchange.html">
</form>
</td>
</tr>
<tr>
<td align="right">
<table width=220 bgcolor=black cellpadding=4>
<tr>
<td class="b" bgcolor="#4D422E" background="http://www.runescape.com/img/brownback.jpg" align="center">
<b>Need an account?</b><br>
To create an account to access our game and secure services,
<a href="https://create.runescape.com/index.html" class=c>Click Here</a>
</td>
</tr>
</table>
</td>
<td width=20>&nbsp;</td>
<td align="left">
<table width=220 bgcolor=black cellpadding=4>
<tr>
<td class="b" bgcolor="#4D422E" background="http://www.runescape.com/img/brownback.jpg" align="center">
<b>Lost password?</b><br>
If you have lost/forgotten your password or need to recover your account,
<a href="https://password.runescape.com/passsupport.html" class=c>Click Here</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<br>
<div class="tandc">This website and its contents are copyright © 1999 - 2007 Jagex Ltd.<br>
Use of this website is subject to our <a href="http://www.runescape.com/terms/terms.ws" class=c>Terms+Conditions</a>
and <a href="http://www.runescape.com/privacy/privacy.ws" class=c>Privacy policy</a>
</div>
</div>

</body>
</html>

thx.

Link to comment
Share on other sites

You are right about the form elements... your challenge is with the form itself as it does not have a name. In these cases you need to use _IEFormGetCollection and get the form by index instead. Since there is only one form on this page, the first and only index is 0. So...

$oForm = _IEFormGetCollection($oIE, 0)

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

I was wondering why this didnt read that the page was done loading it just seems to hang there on form submit.

#include <IE.au3>
$oIE = _IECreate ("http://www.runescape.com/loginform.ws?mod=password_history&dest=passchange.html")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
_IEFormElementSetValue ($oQuery, "username")
$oQuery = _IEFormElementGetCollection ($oForm, 1)
_IEFormElementSetValue ($oQuery, "password")
_IEFormSubmit ($oForm, 1)

$sHTML = _IEBodyReadHTML ($oIE)
MsgBox(0, "", $sHTML)
Edited by D4rk^S0ul
Link to comment
Share on other sites

Try replacing

_IEFormSubmit ($oForm, 1)

with

_IEFormSubmit ($oForm, 0)

_IELoadWait($oIE)

_IEFormSubmit tries to do a LoadWait on the form object and this often causes trouble. The suggested code tells the form submite not to wait and then does the wait manually on the browser.

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

Thx worked great.

1 Thing i am having trouble with aswell is httpsetproxy command it doesnt work for me i quickly made a program to open whatismyip.com and even though the proxys should of been changing it didnt work. I also tried it on its own with a direct ip rather then a line from a file and it still didnt work?

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...