I couldn't be any newer to VBA and slowly worked out my first module. What I can't get is all the imported data to show in different cells. It just lines up in a single cell with no spaces
Also is there a way to automatically move the number on the website URL forward by 1 and bring in that new data in the next column. (I have removed the https://www from the below example so the code would display correctly
Sub Get_Web_Data()
Dim request As Object
Dim response As String
Dim html As New HTMLDocument
Dim website As String
Dim price As Variant
website = sportsbookreview.com/betting-odds/nba-basketball/3569074/odds/"
Set request = CreateObject("MSXML2.XMLHTTP")
request.Open "GET", website, False
request.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
request.send
response = StrConv(request.responseBody, vbUnicode)
html.body.innerHTML = response
price = html.getElementsByClassName("_3DLFC").Item(0).innerText
ActiveSheet.Range("A1") = price
Range("A1") = price
End Sub
Also is there a way to automatically move the number on the website URL forward by 1 and bring in that new data in the next column. (I have removed the https://www from the below example so the code would display correctly
Sub Get_Web_Data()
Dim request As Object
Dim response As String
Dim html As New HTMLDocument
Dim website As String
Dim price As Variant
website = sportsbookreview.com/betting-odds/nba-basketball/3569074/odds/"
Set request = CreateObject("MSXML2.XMLHTTP")
request.Open "GET", website, False
request.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
request.send
response = StrConv(request.responseBody, vbUnicode)
html.body.innerHTML = response
price = html.getElementsByClassName("_3DLFC").Item(0).innerText
ActiveSheet.Range("A1") = price
Range("A1") = price
End Sub