Here is my current code:
The problem is the page I am trying to pull data from has a ton of tables on it.
In the source code I found the table id:
Is there any way to use this info to only pull that specific data?
Code:
[FONT=courier new]Sub Pull_URL_Data()
Dim myURL As String: 'URL String
myURL = "https://www.website.com
Call pullDataSingleURL(myURL, Sheets("Sheet1"))
End Sub
Function pullDataSingleURL(URL As String, ws As Worksheet)
'Add: (menu) Tools/References/'Microsoft XML V6.0' & 'Microsoft Forms 2.0 Object Library'
'Dim httpRequest As XMLHTTP 'XML V6.0
Dim httpRequest As MSXML2.XMLHTTP60 'MSXML2.DOMDocument
Dim DataObj As New MSForms.DataObject 'Forms 2.0
'Set httpRequest = New XMLHTTP
Set httpRequest = CreateObject("MSXML2.XMLHTTP.6.0")
httpRequest.Open "GET", URL, False
httpRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
httpRequest.send ""
DataObj.SetText httpRequest.responseText
DataObj.PutInClipboard
DoEvents
With ws
.Activate
.Cells.Clear
.Cells(1, 1).Select
.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
End Function[/FONT]
The problem is the page I am trying to pull data from has a ton of tables on it.
In the source code I found the table id:
Code:
table id="function-4300002411" class="sortable result-table align-left"
Is there any way to use this info to only pull that specific data?
Last edited: