Jump to content

IE function to click on nav button


Recommended Posts

Hi all,

I am having an issue with a website that I want to automate.

I have this menu and I want to click on the Custom button.

17e42ee0ec.png

 

 

The buttons with "inspect element" are: 

 

17ea05bcde.png

 

The code that I tried is

$sSearch = "Custom"
$oFrame = _IEFrameGetObjByName($oIE, "options")
$oDivs = _IETagNameGetCollection($oFrame, "ul")
For $oDiv In $oDivs
    If String(_IEPropertyGet($oDiv, "InnerText")) = $sSearch Then
        _IEAction($oDiv, "click")
        ExitLoop
    EndIf
Next

I also tried with:

$sMyString = "Custom"
Local $oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    Local $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next

 

However, these are not working. Any ideas?

 

 

Edited by PunkoHead
Link to comment
Share on other sites

Can't really provide further assistance until you provide more details. Help us help you! ;-)

1 hour ago, PunkoHead said:

However, these are not working. Any ideas?

Details will go a long way here. Instead of saying "Doesn't work", provide us with the output from the Scite window.

I noticed that you tried using IEFrameGetObjByName. Does the page actually use frames?

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

×
×
  • Create New...