PLS Help!!! ABout VBA in Excel


Pls Help. How can I Get only number/rate using vba in excel

This my code in vba

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 to go to.
Website = ""

' Create the object that will make the webpage request.
Set request = CreateObject("MSXML2.XMLHTTP")

' Where to go and how to go there - probably don't need to change this.
request.Open "GET", Website, False

' Get fresh data.
request.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"

' Send the request for the webpage.

' Get the webpage response data into a variable.
response = StrConv(request.responseBody, vbUnicode)

' Put the webpage into an html object to make data references easier.
html.body.innerHTML = response

' Get the price from the specified element on the page.
Range("a1") = html.getElementsByClassName("products__exch-rate").Item(0).innerText

End Sub

Screenshoot wrong how do I edit it like this?

Pls Help me



Selected Answer

Change  html.ElementsByClassName to:

Range("a1") = html.getElementsByName("ppu-3604576").Item(0).innerText

Or Download File


Answer the Question

You must create an account to use the forum. Create an Account or Login