KillingEye Posted December 24, 2008 Share Posted December 24, 2008 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 More sharing options...
rasim Posted December 24, 2008 Share Posted December 24, 2008 Try this: $sFile = @ScriptDir & "\test.htm" $sRead = FileRead($sFile) $sResult = "" $aResult = StringRegExp($sRead, '(?i)type="text" name="(.*?)"|type="password" name="(.*?)"', 3) $sResult &= $aResult[0] & @CRLF $sResult &= $aResult[2] & @CRLF MsgBox(0, "Result", $sResult) Link to comment Share on other sites More sharing options...
KillingEye Posted December 24, 2008 Author Share Posted December 24, 2008 I will try it! ty... but a want that the script read the source code of a website... and not of a html file on my pc Link to comment Share on other sites More sharing options...
DaleHohm Posted December 24, 2008 Share Posted December 24, 2008 (edited) 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 December 24, 2008 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 More sharing options...
KillingEye Posted December 27, 2008 Author Share Posted December 27, 2008 Nice job Ty!!! It Works Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now