Hi,
I need to load every day some text from different webpages from our client.
I'm surfing with this code to a webpage and the code will click the desired link. I will come then on the 2nd page but I also need to click on this page on a link. How can I also click a link on the 2nd page that is loaded?
Sub BrowseToSpecificUrl(Url As String, Target_Url As String)
Dim IE As New SHDocVw.InternetExplorer
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.IHTMLElement
Dim HTMLAs As MSHTML.IHTMLElementCollection
Dim HTMLA As MSHTML.IHTMLElement
IE.Visible = True
IE.navigate (Url)
Do While IE.ReadyState <> READYSTATE_COMPLETE
Loop
Set HTMLDoc = IE.Document
Set HTMLAs = HTMLDoc.getElementsByTagName("a")
For Each HTMLA In HTMLAs
If HTMLA.getAttribute("href") Like Target_Url Then
HTMLA.Click
Exit For
End If
Next HTMLA
Do While IE.ReadyState <> READYSTATE_COMPLETE
Loop
End Sub