Jump to content

Recommended Posts

Posted (edited)

I am trying to click on td items using this code :

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IEAttach ("Webpage")
$sMName = "Akshay Vora"
Local $oTDs = _IETagNameGetCollection($oIE, "td")
  For $oTD in $oTDs
  If String($oTD.InnerText) = $sMName Then
MsgBox(0, "", $sMName & @CRLF & $oTD.InnerText)
      _IEAction($oTD, "click")
      ExitLoop
      EndIf
  Next

Working on other td items

But, If $sMName = First TD It showing msgbox but not click on matched first td item.

Edited by jmp
Posted
19 hours ago, jmp said:

I am trying to click on td items using this code :

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IEAttach ("Webpage")
$sMName = "Akshay Vora"
Local $oTDs = _IETagNameGetCollection($oIE, "td")
  For $oTD in $oTDs
  If String($oTD.InnerText) = $sMName Then
MsgBox(0, "", $sMName & @CRLF & $oTD.InnerText)
      _IEAction($oTD, "click")
      ExitLoop
      EndIf
  Next

Working on other td items

But, If $sMName = First TD It showing msgbox but not click on matched first td item.

Ohh ! I am Noticed it was not working becuase another TD item already exists with same value before it and it was not clickable.

 

<tr>
                                <th>Main Name</th>
                                <td>Akshay Vora</td>
                            </tr>

Not want to click on it

But, I want to click on it :

main.JPG.321eb19ee2929c2575fc9e2dc44833db.JPG

Any Ideas ??

Posted
8 minutes ago, Danp2 said:

It isn't clear where you placed this line. My expectation was that you would replace the existing _IEAction line with this new one.

@Danp2

I am replaced the existing _ieaction line with your line but i am getting error.

Posted
3 minutes ago, Danp2 said:

Ok... then do this instead --

$oRow = $oTD.parentElement
    _IEAction($oRow, "click")

 

@Danp2 It is clicking but same as "

Ohh ! I am Noticed it was not working becuase another TD item already exists with same value before it and it was not clickable.

"

Posted (edited)
37 minutes ago, Danp2 said:

You haven't provided enough details for us to help further. Is this TD element part of the same table or a different table? Can you save the full HTML to a file and attach it here?

@Danp2  i tried with this code and it was working for me 

$oTable = _IETableGetCollection ($oIE, 1)
$oTds = _IETagNameGetCollection($oTable, "td")
For $oTD in $oTDs
if String($oTD.innertext) = $sMName Then
MsgBox(0, "", $oTD.innertext)
_IEAction($oTD, "click")
ExitLoop
EndIf
  Next

Because $sMName was located twice in two separate tables.

When i use this code

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IEAttach ("Webpage")
$sMName = "Akshay Vora"
Local $oTDs = _IETagNameGetCollection($oIE, "td")
  For $oTD in $oTDs
  If String($oTD.InnerText) = $sMName Then
MsgBox(0, "", $sMName & @CRLF & $oTD.InnerText)
      _IEAction($oTD, "click")
      ExitLoop
      EndIf
  Next

This was click on $sMName that was located in first table.

Edited by jmp

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
×
×
  • Create New...