Jump to content

get a formname from html source code


Recommended Posts

Hi,

how can my autoitscript read a name of a form object?

Part of the html code:

<form method="post" name="snd" action="dorf1.php">
<input type="hidden" name="w" value="">
<input type="hidden" name="login" value="1230109235">

<p><table class="p1" style="width:100%"cellspacing="1" cellpadding="0"><tr><td>

<table width="100%" cellspacing="1" cellpadding="0">
<tr><td><label>Name:</label>
<input class="fm fm110" type="text" name="e8790fb" value="" maxlength="15"> <span class="e f7"></span>
</td></tr>
<tr><td><label>Passwort:</label>
<input class="fm fm110" type="password" name="e88b613" value="" maxlength="20"> <span class="e f7"></span>
</td></tr>
</table></td></tr></table></p>

I need the value of the name :

type="text" name="e8790fb"

and the value of this

type="password" name="e88b613"

The "e8790fb" and the "e88b613" is needed.

so how can i do this?

Ty for any Help ^^

Link to comment
Share on other sites

Take a look at the _IE funcions. This will get you started:

#include <IE.au3>
$oIE = _IECreate(your-url) ; or use _IEAttach
$oForms = _IEFormGetCollection($oIE, 0) ; not the first form? use 1, 2, 3 till you find it
$oUName = _IEFormElementGetCollection($oForm, 2)
$oPasswort = _IEFormElementGetCollection($oForm, 3)

$sUName = $oUName.name
$sPasswort = $oPasswort.name

Dale

Edited by DaleHohm

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