coolcurrent
Newbie
- Feb 15, 2011
- 25
- 0
I tried without success to click the facebook like button in code with the webrowser control, but it doesn't work, here is the cod i used
Code:
Private Sub ClickLikeUnlike()
'# click like or Unlike button here
On Error GoTo ErrorHandler:
Dim InputCollection As HTMLElementCollection
Dim curElement As HTMLHtmlElement
Dim href As HTMLAnchorElement
Dim HtmlDoc As HTMLDocument
Set HtmlDoc = wbMain.document
Set allelement = HtmlDoc.All
For Each href In HtmlDoc.links
If LCase$(href.innerText) = "like" Then
Debug.Print href.innerHTML
href.Click
Exit For
Else
Debug.Print href.innerHTML
End If
Next
Exit Sub
ErrorHandler:
Debug.Print Error
End Sub