Jump to content

Recommended Posts

Posted

I am trying to script a login to a complex web site that has multiple pop up frames. I have gotten through several levels by using IEBuilder and DebugBar but cannot seem to find the link to click on in the web page code below. The link in question below is test company. I used the AutoITcode below from the examples included in the help file to determine that _IELinkGetCollection will find 11 links (Only two included in the web code below for brevity) but I cannot seem to get the link index to return so that I can click the link later in the script. IEBuilder does not work with Frames and Debug Bar does allow me to see the code below using the Spy on other IE Instances function but I do not see how I can get the indexes with these tools.

[/code]

<FORM name=Form1 method=post><INPUT type=hidden value=2 name=fNum> <INPUT type=hidden value=list name=fMode> <INPUT type=hidden value=0-* name=StateKey> 
<DIV align=left width="100%">
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TH class=headlbl><IMG id="" src="../images/clients_ico.gif" valign="bottom">&nbsp;My Recent Clients</TH></TR></TBODY></TABLE>
<DIV id=mycls>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD noWrap><IMG title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" src="../images/irolodex_bot.gif"> <A title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" href="#top"><I><B>Client Rolodex</B></I></A></TD></TR>
<TR>
<TD noWrap><A title=TESTCOM style="TEXT-INDENT: 5%" onclick="LoadPage 'key=168191&amp;code=TESTCOM&amp;name=Test+Company&amp;phone=410+675%2D9286+'" href="#top">Test Company</A></TD></TR>
<TR>
Smalll portion of my test code trying to return the link indexes. I have the DOM object href listed here. It works and returns the frame URL but I need the link index number so I can click it. I have tried several other DOM objects but they return nothing. Any help would be much appreciated.
$oInputs = _IELinkGetCollection ($oIE, 0)$iNumFrames = @extendedFor $i = 0 to ($iNumFrames - 1) $oFrame = _IELinkGetCollection ($oIE, $i) MsgBox(0, "Index Info ", $oFrame.href)Next


            
        

        

        
    

    
    

    

                    
                    
                        
                            


     (adsbygoogle = window.adsbygoogle || []).push({});

                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


vcrocca
            
            
                Posted 
                
            
        
    
    
        


vcrocca
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 23
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            I figured it out at long last. 

Is there a tutorial somewhere on how to get zero based indexes? Looking in the help file it's not readily apparent how to do this. 

A quick write up on this with some specific examples will help a lot of newbies IMHO. 


I am trying to script a login to a complex web site that has multiple pop up frames. I have gotten through several levels by using IEBuilder and DebugBar but cannot seem to find the link to click on in the web page code below. The link in question below is test company.  I used the AutoITcode below from the examples included in the help file to determine that _IELinkGetCollection will find 11 links (Only two included in the web code below for brevity) but I cannot seem to get the link index to return so that I can click the link later in the script. IEBuilder does not work with Frames and Debug Bar does allow me to see the code below using the Spy on other IE Instances function but I do not see how I can get the indexes with these tools.
 



[/code]

<FORM name=Form1 method=post><INPUT type=hidden value=2 name=fNum> <INPUT type=hidden value=list name=fMode> <INPUT type=hidden value=0-* name=StateKey> 
<DIV align=left width="100%">
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TH class=headlbl><IMG id="" src="../images/clients_ico.gif" valign="bottom">&nbsp;My Recent Clients</TH></TR></TBODY></TABLE>
<DIV id=mycls>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD noWrap><IMG title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" src="../images/irolodex_bot.gif"> <A title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" href="#top"><I><B>Client Rolodex</B></I></A></TD></TR>
<TR>
<TD noWrap><A title=TESTCOM style="TEXT-INDENT: 5%" onclick="LoadPage 'key=168191&amp;code=TESTCOM&amp;name=Test+Company&amp;phone=410+675%2D9286+'" href="#top">Test Company</A></TD></TR>
<TR>
Smalll portion of my test code trying to return the link indexes. I have the DOM object href listed here. It works and returns the frame URL but I need the link index number so I can click it. I have tried several other DOM objects but they return nothing. Any help would be much appreciated.
$oInputs = _IELinkGetCollection ($oIE, 0)$iNumFrames = @extendedFor $i = 0 to ($iNumFrames - 1) $oFrame = _IELinkGetCollection ($oIE, $i) MsgBox(0, "Index Info ", $oFrame.href)Next



			
		
Posted (edited)

I figured it out at long last.

Is there a tutorial somewhere on how to get zero based indexes? Looking in the help file it's not readily apparent how to do this.

A quick write up on this with some specific examples will help a lot of newbies IMHO.

Huh? :)

All the indexes in IE.au3 that I can think of are zero-based. The help file entry on _IELinkGetCollection() for example:

Parameters

$o_object Object variable of an InternetExplorer.Application, Window or Frame object

$i_index Optional: specifies whether to return a collection or indexed instance

0 or positive integer returns an indexed instance

-1 = (Default) returns a collection

So the first link is just $oLink = _IELinkGetCollection($oIE, 0)

The first form is $oForm = _IEFormGetCollection($oIE, 0)

etc.

Your topic here is now the write up...

:)

Edit: Typo

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

IE Builder (see my sig) will also help you with this.

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

  • 3 weeks later...
Posted

IE Builder (see my sig) will also help you with this.

Dale

Thanks Dale! I have used IEBuilder and it is a great tool but in this situation when new instances of Internet Explorer were opened as Frames and sub frames IEBuilder does not see the objects in the frame.

I found that only DebugBar with it's spy feature would do this. If I missed something on how to use IEBuilder please let me know.

Posted

You are doing as I do by using DebugBar Spy. IE Builder does not drill into Frames unless you point it at the frame src.

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...