Jump to content

Problem Capturing Button In Html Object.


Libre
 Share

Recommended Posts

how i can capture any of the buttons of this html, i need to get the object of theese bottons.

$oIEConsejo = ObjCreate("Shell.Explorer.2")
    $GUIActiveXConsejo = GUICtrlCreateObj($oIEConsejo, 20, 60, 440,260)
    GUICtrlSetStyle($GUIActiveXConsejo, $WS_VISIBLE)
    $oIEConsejo.navigate (@ScriptDir & "\test.html")
    
    
    
    _IEAction($GUIActiveXConsejo,"refresh")
    
;_ArrayDisplay( _IEFormElementGetCollection($oIEConsejo))
;$aWebBotton = _IEFormGetObjByName($oIEConsejo, "Submit")
;$aWebBotton = _IEFormElementGetObjByName($aWebBotton, "Submit2", 2) 
;MsgBox(0,"",$aWebBotton)

i did some test but i cant get the button. Please Help

HTLM FILE test.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<body>
<div align="center">
<table width="400" border="1" bgcolor="#C4D7EA">
  <tr>
    <td width="395">
<div align="center"><strong>Notifications</strong></div></td>
  </tr>

</table>
<table width="400" border="1" bordercolor="#E8C87D" bgcolor="#FDF2C6">
  <tr> 
    <td width="386" height="68">
<p><strong>Aqui se puede poner el texto mostrandole 
        de que val el msg y por que puede servirle de ayuda.</strong><strong>Y 
        al lado van los botones para borrar o ejecutar</strong></p>
    </td>
    <td width="80" align="center" valign="top"> 
      <p align="center"> 
        <input type="submit" name="Submit" value="Ejecutar">
      </p>
      <p align="center"> 
        <input type="submit" name="Submit2" value="Borrar">
      </p></td>
  </tr>
</table>

<P> </p>

<p> </p>
</body>
</html>

I love this Game :p----------------------Freeware Multilange support or Translate your scripts----------------------aNyBoDy KnOwS WhY A LiGhT iN My KeYbOaRd iS aLlWaIs BlInKiNg !?Who is "General Failure" and what is he doing in my hard disk !!!!!?

Link to comment
Share on other sites

$oie.document.parentwindow.execscript("var a = document.getElementByName('Submit");var b = document.getElementByName('Submit2');")
$btn1 = $oie.document.parentwindow.eval("a")
$btn2 = $oie.document.parentwindow.eval("b")

That should work

----UNTESTED----=

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

@Libre

Are you sure that is all the HTML code? You have <Input> tags, but no a <form> tag.

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

hi thanks x the answers.

my problem was fixed yesterday.

i dont know if is the best way, but iS the only way i know.

http://www.autoitscript.com/forum/index.php?showtopic=24127

i made it with javascript.

And yes, the html of the top of this topic is bad, was my first try.

Edited by Libre

I love this Game :p----------------------Freeware Multilange support or Translate your scripts----------------------aNyBoDy KnOwS WhY A LiGhT iN My KeYbOaRd iS aLlWaIs BlInKiNg !?Who is "General Failure" and what is he doing in my hard disk !!!!!?

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