1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

click on 1st Reply on webpage with VBA

Discussion in 'Business Applications' started by fanku, Jan 24, 2015.

Thread Status:
Not open for further replies.
  1. fanku

    fanku Thread Starter

    Joined:
    Jan 8, 2015
    Messages:
    4
    Sub test()
    Application.ScreenUpdating = False
    the_Start:
    Dim i As Long
    Dim ie As Object
    Dim objElement As Object
    Dim objCollection As Object

    ' Create InternetExplorer Object
    Set ie = CreateObject("InternetExplorer.Application")

    ie.Visible = True



    ie.navigate myurl ''''"http://zarabol.rediff.com/Tata-Power-Company-Ltd/7209896"

    Do
    DoEvents

    If Err.Number <> 0 Then
    objIE.Quit
    Set ie = Noting
    Goto the_Start:
    End If
    Loop Until ie.readyState = 4


    ''--- Pls help me to write code to click on 1st Reply link and post my reply as " Best Buy - Hold it "
    ''-- on this page there are many Reply link..but i wish to click on 1st Reply.
    ' Pls open attachment i have marked Reply with red circle to be clicked.


    "-----------------------------------------------------------------------------

    Application.ScreenUpdating = True
    Set ie = Nothing
    End Sub
     

    Attached Files:

  2. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    I told you I do not know what.
    I tried this but that's as far as I know.
    Code:
    Sub test()
    the_Start:
        Dim i As Long
        Dim ie As Object
        Dim objElement As Object
        Dim objCollection As Object
        Dim myUrl   As String
         ' Create InternetExplorer Object
        Set ie = CreateObject("InternetExplorer.Application")
        ' You can uncoment Next line To see form results
        ie.Visible = True  'False
        ' Send the form data To URL As POST binary request
        Range("A2").Select
        Do While ActiveCell.Offset(0, 0).Value <> ""
            'IE.Navigate "http://zarabol.rediff.com/Mahindra-Mahindra-Ltd/7155512"
            myUrl = ActiveCell.Offset(0, 1).Value
            ie.navigate myUrl ''''"http://zarabol.rediff.com/Mahindra-Mahindra-Ltd/7155512"
            Do
               DoEvents
                
                If Err.Number <> 0 Then
                    ie.Quit
                    Set ie = Nothing
                    GoTo the_Start:
                End If
            Loop Until ie.readyState = 4
            
            'IE.document.getElementById("msg").Value = "Stop UR Loss | Book Profit Everyday | 100% Free Advisory | 60-40 Profit Sharing | Call now or whats app | 9930736688 |"
    '        ie.document.getElementById("msg").Value = " Target : 500 SL 495"
    '        ie.document.getElementById("postbtn").Click
            ie.document.getElementById("submitbtn").Click
            ActiveCell.Offset(1, 0).Select
            GoTo exitSub
        Loop
    ie.Quit
    exitSub:
    Set ie = Nothing
    End Sub
    
    '     var usr_email       = document.getElementById('txtlogin').value;
    '    var usr_password    = document.getElementById('pass_box').value;
    '    if (usr_email.indexOf("@") == -1)
    
    
     
  3. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Ask for hel to enter userid and password in resulting screen.
    I do not know how to do that
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - click Reply webpage
  1. DaveA
    Replies:
    10
    Views:
    698
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1141797

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice