Scraping web page gets complicated. Got the following to work:
Code:
Sub test()
Dim htm As Object
Dim Tr As Object
Dim Td As Object
Dim Tab1 As Object
Dim Web_URL As String
Dim ie As Object
Dim iTable As Integer'Replace the URL of the webpage that you want to download
Web_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vTeVs6qiVE6YQ1MUeK_9NHa-URkdR7D6KEr4y6Sj-EtQuyBRf-3s7rfSI0iO3mzgUut6pwBxi-3chO9/pubhtml?gid=0&single=true"
'open Internet Explorer and go to website
Set ie = New InternetExplorer
ie.Visible = False
ie.Navigate Web_URL
Do While ie.ReadyState <> READYSTATE_COMPLETE
'Application.StatusBar = "Trying to go to webpage ..."
DoEvents
Loop
'Create HTMLFile Object
Set htm = ie.Document
Set ie = Nothing
'Loop through each table
For Each Tab1 In htm.getElementsByTagName("table")
With htm.getElementsByTagName("table")(iTable)
For Each Tr In .Rows
For Each Td In Tr.Cells
If Td.ClassName Like "S*" Then
CurrentDb.Execute "INSERT INTO Table1(WebTest) VALUES('" & Td.innertext & "')"
End If
Next Td
Next Tr
End With
iTable = iTable + 1
Next Tab1
End Sub
Alternative is to use Excel's Get External Data to import from web page. That worked very nicely. AFAIK, equivalent is not available in Access.