Consulting

Results 1 to 2 of 2

Thread: VBA for click on BUTTON Internet DOCUMENT

  1. #1

    VBA for click on BUTTON Internet DOCUMENT

    Dear Sir


    I am Trying to click on button by VBA on internet document. but did not get successes. getting some error.


    here bellow is my URL


    https://www.justdial.com/Ahmedabad/S...026-I9L7_BZDET


    here bellow is my Code


    Public Sub JDLOGIN()
    
    
    'On Error Resume Next
        Dim Sn As Integer
        Dim ie As Object
        Dim url As String
        Dim Doc As HTMLDocument
        
       url = "https://www.justdial.com/Ahmedabad/Simran-Skin-Hair-Beauty-Clinic-Near-Judges-Banglows-Bodakdev/079PXX79-XX79-160917190026-I9L7_BZDET"
        Set ie = CreateObject("InternetExplorer.Application")
    
    
        With ie
          .Visible = 0
          .navigate url
           While .Busy Or .readyState <> 4
             DoEvents
           Wend
        End With
    
    
         Call ie.document.parentWindow.execScript("javascript:submt_os('2','whatsapptriggeer','whatsapptriggeer')")
       
        
    
    
    End Sub



    my be you will not get this ID "whatsaaptriggeer" in html in your PC/Laptop, because they need mobile number first to enter.


    find my HTML


    https://pastebin.com/1s8mkzij


    you can that ID in this HTML in Row no. 25


    please help me out how can I click this button by VBA

  2. #2
    VBAX Regular
    Joined
    Oct 2018
    Posts
    7
    Location
    Dear lulupatel,

    On the IE, choose "inspect element" of the button you want to click. If you got the ID, hope this segment code may help your problem:

        Do While IE.Busy
            Application.Wait DateAdd("s", 1, Now)
        Loop
        
        For Each elem In IE.document.GetElementsByTagName("INPUT")
            If elem.ID = "ButtonID" Then
                elem.Click
                Exit For
            End If
        Next elem

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •