Sign in to follow this  
Followers 0
TinyBoy

[solved] How to click a IE control who has no name and id ?

3 posts in this topic

#1 ·  Posted (edited)

I want to click on the "Apply" button in this page, but there is no name or id

Here the source code:

CODE

<html>

<head>

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Basic Status - Initial Scan</title>

<script language="javascript">

<!-- hide me

// show me -->

</script>

</head>

<body>

<table border="0" cellspacing="0" width="100%" id="AutoNumber1" height="488" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0">

<tr>

<td width="100%" height="19" colspan="2" bgcolor="#394A84">&nbsp;

<a href="BasicLan.htm"><img border="0" src="btn_basic_lan_status_y.gif"></a>

<!--

<a href="ProductDetail.htm"><img border="0" src="btn_advanced_wan_w.gif"></a>

-->

<!-- <a href="techsupport.htm"><img border="0" src="btn_support_w.gif"></a> -->

</td>

</tr>

<tr>

<td width="165" height="116" align="center" style="border-left-style: none; border-left-width: medium; border-right-style: solid" bordercolor="#394A84"><a href="http://www.thomson.net">

<img border="0" src="logo_new.gif" width="154" height="106"></a></td>

<td width="119%" height="116" align="left" style="border-bottom: 0px solid #C0C0C0">

<p style="margin-left: 20; margin-top: 0; margin-bottom: 0">

<span style="text-decoration: blink">

<font face="Arial" style="font-size: 20pt; font-weight:700">Basic Status</font></span></p>

<p style="margin-left: 20; margin-top: 0; margin-bottom: 0">&nbsp;</p>

<p style="margin-left: 20; margin-top: 0; margin-bottom: 0"><b>

<font face="Arial" style="font-size: 13pt">Initial Scan</font></b></p>

<p style="margin-left: 20; margin-top: 0; margin-bottom: 0">

<font face="Arial" style="font-size: 11pt">To speed up the modem's first time startup,

enter DS frequency and/or US channel ID here.</font></p>

</td>

</tr>

<tr>

<td width="165" height="322" align="center" valign="top" style="border-left-style: none; border-left-width: medium; border-right-style: solid" bordercolor="#394A84">&nbsp;

<p><a href="BasicLan.htm"><img border="0" src="btn_basic_lan_w_g.gif"></a></p>

<p><a href="HardwareInfo.htm"><img border="0" src="btn_hardware_info_w_g.gif"></a></p>

<p><a href="EventLog_CM.htm"><img border="0" src="btn_event_log_w_g.gif"></a></p>

<p><a href="CmState.htm"><img border="0" src="btn_cm_state_w_g.gif"></a></p>

<p><a href="InitialScan.htm"><img border="0" src="btn_initialscan_y.gif"></a></p>

</td>

<td width="82%" height="322" align="left" valign="top">&nbsp;

<hr>

<form action=/goform/InitialScan method=POST name="InitialScan">

<table>

<tr valign=top>

<td>

<table>

<tr>

<td><strong>Initial DS frequency:&nbsp;</td>

<td><input type="text" name= "mCmInfoDsFreq1" size="12" maxlength="9" value="586000000">&nbsp;&nbsp;&nbsp;</td>

<td><strong>Upstream Channel ID:&nbsp;</td>

<td><input type="text" name="mCmInfoUsId1" size="12" maxlength="3" value="2"></td>

</tr>

</table>

<br>

</td>

</tr>

<tr>

<td colspan=3 align=center><input type="Submit" value="Apply" align="MIDDLE"></td>

</tr>

</table>

</form>

</td>

</tr>

<tr>

<td width="100%" height="19" colspan="2" bgcolor="#394A84">&nbsp;</td>

</tr>

</table>

<p><font size="1">&copy; 2005 Thomson Inc.&nbsp; All rights reserved.</font></p>

</body>

</html>

It is line 13 from the bottom.

This is my code. Questionmarks shouild be reolaced by what ?

$oObject = _IEGetObjByName($oIE, "????")
_IEAction($oObject, "click")

TIA for any support. :)

Edited by TinyBoy

Share this post


Link to post
Share on other sites



First, get DebugBar (see my sig) and then see _IEFormElementGetCollection

$oForm = _IEFormGetObjByName($oIE, "InitialScan")

$oApply = _IEFormElementGetCollection($oForm, 2)

_IEAction($oApply", "click")

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

Share this post


Link to post
Share on other sites

First, get DebugBar (see my sig) and then see _IEFormElementGetCollection

$oForm = _IEFormGetObjByName($oIE, "InitialScan")

$oApply = _IEFormElementGetCollection($oForm, 2)

_IEAction($oApply", "click")

Dale

Dale, thanks a lot. You are the IE hero ! :)

Works like a charm. :o

But I found the needle >"< in the haystack. LOL :D

_IEAction($oApply", "click")

Again, thanks a lot

Tinyboy

Share this post


Link to post
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
Sign in to follow this  
Followers 0