Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get value from html page 1

There's clearly more to it than simply retrieving 7075. Today, for example, the value appears to be 7076

If you provide a brief explanation of how/why you need this value we can suggest an appropriate solution.
 
Last edited:
strongm the value in web page is dinamic.
When i post the vale is 7075
to day is 7076

Sorry
 
So is your real question is how do you scrape the value at that particular position, NOT how do you scrape 7075
 
Well, no. becasue that value is actually derived from a hidden HTML property of the input form. Which is a good thing, because that's easy to capture


Rich (BB code):
Option Explicit

Public Sub spoon()
    Dim html 
    Dim fonttags
    Dim inputtags
    Dim inputtag

    Set html = New HTMLDocument
    With CreateObject("MSXML2.XMLHTTP")
        .Open "GET", "https://massimilianobenvenuti.it/i-numeri-piu-frequenti-nelle-10-ruote-del-lotto/", False
        .send
        html.body.innerHTML = .responseText
    End With
    
    Set inputtags = html.getElementsByTagName("input")

    For Each inputtag In inputtags
    If inputtag.Name = "estrazioni" Then
            Debug.Print inputtag.Max
        End If
    Next inputtag

End Sub
 
tks bro work great.

only a tips...

I have goggoling to find a func for MSXML2.XMLHTTP, similar when i use IE object to be sure the page is really charged

Do While .Busy: DoEvents: Loop
Do While .readystate <> 4: DoEvents: Loop

i have tested one with:

Set html = New HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://massimilianobenvenuti.it/i-numeri-piu-frequenti-nelle-10-ruote-del-lotto/", False
.send

oXMLDoc2.async = False
If oxmlhttp2.readyState = 4 Or oxmlhttp2.Status = 200 Then
html.body.innerHTML = .responseText
Else
'stop
End if

End With

but have error
 

Part and Inventory Search

Sponsor

Back
Top