Jump to content

Click on a javascript menu


Recommended Posts

Hi guys

i have a web page with a javascript menu and i would like to click in it with autoit.

the source of html page is similar to this (in the bottom of the html code there is the items of the menu. They are in a <script> tag and i'm not able to get theese object)

<script language="javascript" type="text/javascript">
<!--
    function __doPostBack(eventTarget, eventArgument) {
        var theform;
        if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
            theform = document.Form1;
        }
        else {
            theform = document.forms["Form1"];
        }
        theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
        theform.__EVENTARGUMENT.value = eventArgument;
        theform.submit();
    }
// -->
</script>
<script type="text/javascript" src="/ig_common/20051/scripts/ig_shared.js" ></script>

    <script type="text/javascript" src="/ig_common/20051/scripts/ig_webtree.js" ></script>

     <style type="text/css">
<!--
.igt_align {vertical-align:middle;}
--></style>


    <script language="javascript"><!--
igtree_Catalogo1TreeCategorie_Tree=["Catalogo1:TreeCategorie","Catalogo1TreeCategorieSel","","Images/plus.gif","Images/minus.gif",true,false,"Images/",false,

false,0,false,"","","","","",0,true,"","",false,false,10,false,"Catalogo1TreeCategorieRoot","Catalogo1TreeCategorieParent","Catalogo1TreeCategorieLeaf","",""

,"",true];
igtree_Catalogo1TreeCategorie_Levels = [[0,0,,,,,],[1,0,,,,,]];igtree_Catalogo1TreeCategorie_Events = 

[["",0],["",1],["",0],["",0],["",0],["",0],["",0],["",0],["",1],["",0],["",0],["",0],["",0],["",0],["",1],["",1],["",1],["",1],["",0],["",0],["",0],["",0],["

",0],["",0],["",1],];
 --></script>


                        <TABLE  cellSpacing="0" cellPadding="0"  border="0" ms_2d_layout="TRUE">
                            <!--<TR vAlign="top">
                                <TD ></TD>
                            </TR>-->
                            <TR vAlign="top">
                                <TD>
<LINK href="Styles.css" type="text/css" rel="stylesheet">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<META http-equiv="Pragma" content="no-cache">
<!--<script language="Javascript" src="preload.js" type="text/javascript"></script> -->
<script lang="javascript">

function vaia(){
    btnRicerca.focus()
    }
</script>
<TABLE id="Table1" style="BORDER-RIGHT: mediumblue thin; BORDER-TOP: mediumblue thin; BORDER-LEFT: mediumblue thin; BORDER-BOTTOM: mediumblue thin"
    cellSpacing="0" cellPadding="0" width="1020" align="center" border="0">
    <TR>
        <TD align="center">
            <TABLE id="Table3" cellSpacing="0" cellPadding="0" width="100%" border="0">
                <TR>
                    <TD style="BORDER-RIGHT: blue thin solid; BORDER-TOP: blue thin solid; BORDER-LEFT: blue thin solid; BORDER-BOTTOM: 

blue thin solid"
                        align="center" width="49%" colSpan="2"><span id="Catalogo1_Label6" class="TitoloPagina"> RICERCA PER 

SETTORE</span></TD>
                    <TD align="center" width="2%" rowSpan="3"></TD>
                    <TD style="BORDER-RIGHT: mediumblue thin solid; BORDER-TOP: mediumblue thin solid; BORDER-LEFT: mediumblue thin 

solid; BORDER-BOTTOM: mediumblue thin solid"
                        align="center" width="49%" rowSpan="4"><div id='T_Catalogo1TreeCategorie' 

onmouseover="javascript:igtree_mouseover(event,'Catalogo1TreeCategorie');" onmouseout="javascript:igtree_mouseout(event,'Catalogo1TreeCategorie');" 

onkeydown="javascript:igtree_keydown(event,'Catalogo1TreeCategorie');" onkeyup="javascript:igtree_keyup(event,'Catalogo1TreeCategorie');" 

onclick="javascript:igtree_nodeclick(event,'Catalogo1TreeCategorie');" ondblclick="javascript:igtree_dblclick(event,'Catalogo1TreeCategorie');" 

oncontextmenu="javascript:igtree_contextmenu(event,'Catalogo1TreeCategorie');" onselectstart="javascript:igtree_selectStart();" 

onscroll="javascript:igtree_onscroll('Catalogo1TreeCategorie');" style="overflow:auto;  font-family:Franklin Gothic Medium;  font-size:8pt;  

font-weight:normal; width:100%; height:450px; cursor:Auto;"><nobr>

<div align='left' id=M_Catalogo1TreeCategorie><div id='Catalogo1TreeCategorie_1'><span 

style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">CAFFETTIERE              

</span></div>
<div id='Catalogo1TreeCategorie_2'><span style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" 

background:#E4E4E4;">COLTELLERIA              </span></div>
<div id='Catalogo1TreeCategorie_3'><span style="width:16px;margin-left:0px;"></span><span 

igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">COMPLEMENTI CUCINA       </span></div>
<div id='Catalogo1TreeCategorie_4'><span style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">CRISTALLO  </span></div>
<div id='Catalogo1TreeCategorie_5'><span style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" 

background:#E4E4E4;">ELETTRODOMESTICI         </span></div>
<div id='Catalogo1TreeCategorie_6'><span style="width:16px;margin-left:0px;"></span><span 

igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">IDEE REGALO              </span></div>
<div id='Catalogo1TreeCategorie_7'><span 

style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">PENTOLAME                

</span></div>
<div id='Catalogo1TreeCategorie_8'><span style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" 

background:#E4E4E4;">PORCELLANE & CERAMICHE   </span></div>
<div id='Catalogo1TreeCategorie_9'><span style="width:16px;margin-left:0px;"></span><span 

igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">POSATERIA                </span></div>
<div id='Catalogo1TreeCategorie_10'><span 

style="width:16px;margin-left:0px;"></span><span igtxt='1' class="Catalogo1TreeCategorieRoot" style=" background:#E4E4E4;">VETRO                    

</span></div>
</div></nobr><input type=text id='Catalogo1TreeCategorie_tb' 

style="overflow:hidden;position:absolute;left:0px;top:0px;cursor:text;border:indent;border-width:1;display:none;" onfocusout="igtree_endedit(true);" value="" 

onkeydown="igtree_editKeyDown(event,'Catalogo1TreeCategorie');" onkeyup="igtree_editKeyUp(event,'Catalogo1TreeCategorie');" 

ondblclick="igtree_editClickHandler();" onclick="igtree_editClickHandler();"></div><input type="hidden" id="Catalogo1:TreeCategorie" 

name="Catalogo1:TreeCategorie" value=""><script language='javascript'> <!--
igtree_Catalogo1TreeCategorie_cs=[];
var oCatalogo1TreeCategorie = igtree_initTree('Catalogo1TreeCategorie');
--> </script>

and the menu is this:

image of menu

i'm using ie.au3 (_IECreate)

I tried but I'm not able to do it. How can i solve this problem?

Edited by marcotv
Link to comment
Share on other sites

Study the dynamic html (rather than the script, at least initially) using something like DebugBar to see what you need to click on...

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

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