Hi,
I am trying to use VBA to get the number of news results on google news on certain keywords. I have more than a 1000 keywords that I wanted it to run for.
One way, I thought of doing is to use VBA to fetch the source code and extract from the source code, certain text I need.
This is the code that I found. It seems to work fine with many websites, but doesn't return results from certain website, specially http://news.google.com
I would appreciate any help. I am very new to VBA.
Function GetSourcePage(ByVal URL As String) As String
Dim IEapp As Object
Set IEapp = CreateObject("InternetExplorer.Application")
IEapp.Navigate URL
While IEapp.Busy
DoEvents
Wend
GetSourcePage = IEapp.document.DocumentElement.innerHTML
IEapp.Quit
Set IEapp = Nothing
End Function
I am trying to use VBA to get the number of news results on google news on certain keywords. I have more than a 1000 keywords that I wanted it to run for.
One way, I thought of doing is to use VBA to fetch the source code and extract from the source code, certain text I need.
This is the code that I found. It seems to work fine with many websites, but doesn't return results from certain website, specially http://news.google.com
I would appreciate any help. I am very new to VBA.
Function GetSourcePage(ByVal URL As String) As String
Dim IEapp As Object
Set IEapp = CreateObject("InternetExplorer.Application")
IEapp.Navigate URL
While IEapp.Busy
DoEvents
Wend
GetSourcePage = IEapp.document.DocumentElement.innerHTML
IEapp.Quit
Set IEapp = Nothing
End Function