Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

importare tabella tramite html

Ultimo Aggiornamento: 12/04/2018 19:23
Post: 1
Registrato il: 12/04/2018
Città: MILANO
Età: 32
Utente Junior
2016
OFFLINE
12/04/2018 19:23

Ciao a tutti, ho creato questa macro per scaricare le tabelle dal sito soccer24 tramite HTML, l'unico problema è che non riesco a prelevare i dati relativi alla sezione forma, quindi l'ultima colonna.
Sapete se c'è qualche modo per prelevarli??

Sub tabella()

Dim ie as Object
Dim aEle As Object
Dim y As Integer

If ie Is Nothing Then Set ie = CreateObject("InternetExplorer.application")
With ie
.Navigate "https://www.soccer24.com/italy/serie-a/standings/"
.Visible = True
Do While .Busy: DoEvents: Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
End With
Application.Wait Now + TimeValue("00:00:02")

y = 2
For Each aEle In ie.document.getelementbyid("table-type-1").getElementsByTagName("tr")
Debug.Print aEle.textContent
Sheets("foglio1").Range("A" & y).Value = aEle.Children(0).textContent
Sheets("foglio1").Range("B" & y).Value = aEle.Children(1).textContent
Sheets("foglio1").Range("C" & y).Value = aEle.Children(2).textContent
Sheets("foglio1").Range("D" & y).Value = aEle.Children(3).textContent
Sheets("foglio1").Range("E" & y).Value = aEle.Children(4).textContent
Sheets("foglio1").Range("F" & y).Value = aEle.Children(5).textContent
Sheets("foglio1").Range("G" & y).Value = aEle.Children(6).textContent
Sheets("foglio1").Range("H" & y).Value = aEle.Children(7).textContent
Sheets("foglio1").Range("I" & y).Value = aEle.Children(8).textContent
y = y + 1
Next

ie.Quit

End Sub
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 03:02. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com