I struggled with this for about a day. Basically, I want to write an excel macro to scroll through a list in excel, request a webpage and get some data. Ideally, I just want to get the data I need, so I can put it in the next cell, but I would do everything that is needed at this moment.
ASP.net page with which I have no experience; if it were .php, I could probably manage it, but I'm not even sure how to send messages to .aspx via javascript.
I can accurately draw my data, and as soon as I get the data, I can write it to succeed, so there are two parts that I encounter:
Part 1 - requesting a web page
This is the page I want to request . I need to search in the Property Address and retrieve data from the results. The address I will use as an example is 400 W Church St I thought it might just be submitting a form like "... / ParcelSearch.aspx? Name = ... & value = ..." but not a cube.
Part 2 - Data Capture
As a result, there is a DetailsSummary_Master table at the top, with fields that are defined with <legend> tags. I need data in <legend>Municipality</legend> : 
I canโt figure out what to do, iterate over <td> s? I thought maybe I could getElementByID or maybe with a tag, but I canโt figure out how to do this.
Vba
I have used several SO threads to try to figure this out so far. The first , second and third , but I canโt even seem that it works correctly with POST. I keep the hooks separate.
This is what I (stole from another thread) regarding my problem:
Sub SubmitForm() Dim objIE As Object Dim xmlhttp As Object Dim ieButton As Object Dim strResponse As String Dim strUrl As String Dim strID As String Dim strValue As String Dim strSubmit As String strID = "?name=ctl00_ctl00_ctl00_ctl00_ContentMain_ContentMain_ContentMain_ContentMain_TabContainer1_Searches_SubTabContainer1_QuickSearches_CompositAddressSearch1_AddressSearch1_ctl00_Address&value=" strValue = "400 W Church St" strSubmit = strID & strValue strUrl = "http://www.ocpafl.org/searches/ParcelSearch.aspx" Set objIE = CreateObject("InternetExplorer.Application") objIE.navigate "about:blank" Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") '~~> Indicates that page that will receive the request and the type of request being submitted xmlhttp.Open "POST", "http://www.ocpafl.org/searches/ParcelSearch.aspx", False '~~> Indicate that the body of the request contains form data xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" '~~> Send the data as name/value pairs xmlhttp.Send "strSubmit" strResponse = xmlhttp.responseText objIE.navigate strUrl objIE.Visible = True Do While objIE.readystate <> 4 DoEvents Loop objIE.document.Write strResponse Set xmlhttp = Nothing End Sub
I really don't need to run it through IE, I would like to hide it all. I am working on this in Excel 2007 at work, but I have 2010 at home. We also have funny IE8, so the less the better. And I can use a loop or use an array, but I just can't interact with the request. Any help would be greatly appreciated.