• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can't trigger a click on a certain link in a webpage

shahin

Active Member
I've written some code in vba using IE to trigger a click on a link in a certain webpage. However, I can't find any way to click on that very link. If I run my below script the way it is, it neither works nor throws any error and finally quits the browser gracefully

Link to the webpage: http://search.wcad.org/Property-Search-Result?searchtext=319 lizzie taylor

The script I've tried with (failure attempts have also been included which are commented out):
Code:
Sub Clicking_Demo()
    Dim IE As New InternetExplorer, html As HTMLDocument

    With IE
        .Visible = True
        .navigate "http://search.wcad.org/Property-Search-Result?searchtext=319%20lizzie%20taylor"
        Do Until .readyState = READYSTATE_COMPLETE: Loop
        Set html = .document
    End With
    Application.Wait (Now + TimeValue("0:00:05"))
'    html.querySelectorAll(".k-selectable tr[role=row]")(0).Click
'    html.querySelector(".k-selectable tr[role=row] td").Click
    html.getElementsByClassName("k-selectable")(1).Click
    IE.Quit
End Sub

Take a look at the below image in which I tried to show where I wanna perform a click. I've tried to indicate that position with a pencil marker where I wanna click. Clicking anywhere within the grid will do.

Post Script: I've cross posted this same question under one of my account in Stack Overflow.

This is the link to that cross post: https://stackoverflow.com/questions/46927414/unable-to-perform-a-click-on-a-certain-link
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    30.7 KB · Views: 7
Last edited:
Back
Top