Download table from web page

In Access 2010 using VBA I have this procedure to pull a table from website page and download table to access database.

Public Function GetPage(ByVal URL As String) As String
    Dim oXMLHttpRequest As New MSXML2.XMLHTTP
    oXMLHttpRequest.Open "GET", URL, False
    GetPage = oXMLHttpRequest.responseText
End Function

Private Sub cmdPullDataFromWSiteTable_Click()
  Dim rawHtml As String, tableChunk As String, tempFile As String
    Dim tmpAt As Long, tableStart As Long, tableEnd As Long
   rawHtml = GetPage("http://www.exampleSite.aspx")
    ' Search forward until we're just before the table we want
    tmpAt = InStr(1, rawHtml, "Something close to table start tag - example")
    ' Get the index of the start of the opening <table> tag
    tableStart = InStr(tmpAt, rawHtml, "<table")
    ' Get the index of the end of the closing </table> tag
    tmpAt = InStr(tableStart, rawHtml, "</table")
    tableEnd = InStr(tmpAt, rawHtml, ">")

    ' Extract the table
    tableChunk = Mid(rawHtml, tableStart, tableEnd - tableStart +1)
    ' Use native VBA file I/O
    tempFile = "F:\tempTable.Html"
    Open tempFile For Output As #1
    Write #1, tableChunk
    Close #1
    ' Import the file to a table
    DoCmd.TransferText acImportHTML, , "TestTable", tempFile, True

    ' Delete the temp file
    Kill tempFile
End Sub

This works on site where I could see tags for particular table.
I have problem with next site,  site where I can see table in browser  IE but when I open source view  I can not find table tags in source code.
I need to download terminal rack prices table with all those locations.   I do not need legend.
Is it possible to  use same steps (procedure or similar)  as I did on site where I can see particular table tags in source code???
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

why not just go after the downloadable CSV file?
TarasAuthor Commented:
How to do that?
 I was thinking about it. How to do it from VBA in this particular case.?
Since there is a download CSV link, it isn't clear how their terms and conditions apply.
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Jeffrey CoachmanMIS LiasonCommented:
Taras, I am reading this, is not even clear if there is a "Download CSV' link...?
...did I miss something?

In any event, downloading a csv file may be allowed because the site has control over what is actually being downloaded,
...but using code to "scrape" an entire table (without the site's permission, knowledge or consent,) may not be allowed. (as Scott mentioned...)

What we need to know here is if you are "allowed" to do this, expressed permission of the site.
If so, then typically the site will typically provide a more elegant way of getting the data...
(VPN, FTP, custom Export system, ...etc)

The fact that your code works on one site, ...but not on another, points to perhaps the other site not wanting this info to be available/downloaded...

The code you are using there may be interpreted as "Hacking", ...and as such, we at this site are not allowed to respond to such questions...



The download CSV button is inside the frame in the middle of the page.  It is scrollable content and easy to miss.
Jeffrey CoachmanMIS LiasonCommented:
thanks, I see it now

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TarasAuthor Commented:
Thanks for your help I am allowed to donwnload csv file and I will use it. I did not mean to ask for help to do  something that is not permited.And Jeff have point in considering that code is not visible,must  be reason for it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.