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!

NOT FOR ME, get value from table web

sal21

Programmer
Apr 26, 2004
485
IT

Based this lin, how to get numeric value from each table, for:

Bari
Bari
Milano
Firenze
Torino

Note:
the number of table is dinamic

my test code:

Rich (BB code):
Option Explicit
Private Sub Command1_Click()

Dim objHtml As MSHTML.HTMLDocument
Dim objDoc As MSHTML.HTMLDocument
Dim strUrl As String
Dim col As MSHTML.IHTMLElementCollection
Dim element As MSHTML.HTMLInputElement

    strUrl = "https://www.lottologia.com/lotto/previsioni-gruppi-omogenei/"
    
    Set objHtml = New HTMLDocument
    Set objDoc = objHtml.createDocumentFromUrl(strUrl, vbNullString)
    
    Do While objDoc.ReadyState <> "complete"
        DoEvents
    Loop
  
    Set col = objDoc.getElementsByTagName("div")
    For Each element In col
        If element.className = "series col-12" Then
            Debug.Print element.innerText
        End If
    Next element
    
    Set col = Nothing
    Set objDoc = Nothing
    Set objHtml = Nothing
    
End Sub
 
Last edited:

Part and Inventory Search

Sponsor

Back
Top