click on 1st Reply on webpage with VBA

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 

Attachments

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
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)
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
Ask for hel to enter userid and password in resulting screen.
I do not know how to do that
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top