I want to write a macro which will take the search result links in a webpage. I have written like this
Sub webpage()
Dim internet As InternetExplorer
Dim internetdata As HTMLDocument
Dim internetlink As Object
Dim internetinnerlink As Object
Set internet = CreateObject("InternetExplorer.Application")
internet.Visible = True
internet.Navigate ("URL")
Do While internet.Busy
DoEvents
Loop
Do Until internet.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Set internetdata = internet.Document
Set internetlink = internetdata.getElementsByTagName("a")
i = 1
For Each internetinnerlink In internetlink
ActiveSheet.Cells(i, 2) = internetinnerlink.href
i = i + 1
Next internetinnerlink
End Sub
Above code takes all the links from the web page, but i need only the search result links. i have uploaded one image, if that is my webpage, i need to take only the search result links and not all the links. please help me to fix this
tag does not have href property where as tag has it.
– Santosh Nov 15 '13 at 10:59tag , so i thought it is accessible, so is there any way that i can get those search result links..
– Matchendran Nov 15 '13 at 12:46