View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default How to scrape web page data in VBA

On Mar 31, 1:47*pm, Mike wrote:
I need EXCEL to open a web address and *parse out a few data items from that
web location. *What EXCEL macro function(s) can be used to open a web URL and
parse the page source?

The web pages in question are not set up to allow the external date
functions to find the needed data.


Here's another method. It doesn't involve opening and closing IE so
it runs faster. All of the web page information can be extracted from
the source code (using instr, mid, etc) which is contained in
my_var...Ron

Sub Test()
my_url = "http://www.google.com"
Set my_obj = CreateObject("MSXML2.XMLHTTP")
my_obj.Open "GET", my_url, False
my_obj.send
my_var = my_obj.responsetext
Set my_obj = Nothing
End Sub