1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Private Sub CommandButton1_Click()
Dim htmlTabResultat As HTMLGenericElement
Dim htmlLigneResultat As HTMLGenericElement
Dim IE As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim HtmlElementStandard As HTMLGenericElement
Dim y As Integer
y = 1
'Chargement d'une page Web
IE.navigate "https://tv-sports.fr/mercredi-23-octobre-2019"
'Affichage de la fenêtre IE
IE.Visible = True
'On attend
WaitIE IE
'On pointe le document
Set IEDoc = IE.document
' balises
Set coll_1 = IEDoc.getElementsByTagName("div")
'on boucle
For Each cel In coll_1
If cel.className Like "*row grille-item border-top *" Then
On Error Resume Next
' test 1
Sheets("1").Range("a" & y) = cel.Children(0).Children(0).Children(0).innerText ' SPORT
Sheets("1").Range("b" & y) = cel.Children(0).Children(0).Children(1).innerText ' CHAMPIONNAT
Sheets("1").Range("c" & y) = cel.Children(0).Children(1).Children(0).innerText 'EQUIPE
'''
'''Sheets("1").Range("d" & y) = cel.Children(0).innerText ' CHAINE TV ??????????????
Sheets("1").Range("e" & y) = cel.Children(3).Children(0).Children(0).innerText 'direct
Sheets("1").Range("f" & y) = cel.Children(3).Children(0).Children(1).innerText 'Heure
y = y + 1
End If
Next
IE.Quit
Set IE = Nothing
Set IEDoc = Nothing
End Sub |