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
| Sub coursereunion()
'
' coursereunion Macro
'
Mafeuill = "coursereunion"
dossier = "testA.xls"
Dim IE As InternetExplorer
'Initialisation des variables
Set IE = CreateObject("InternetExplorer.Application")
'Chargement d'une page Web Google
IE.Navigate "http://www.geny.com/reunions-courses-pmu/_d2015-04-27"
'Affichage de la fenêtre IE
IE.Visible = True
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set IEDoc = IE.document
nbTable = IEDoc.getElementsByTagName("a").Length
Dim n As Integer
n = 1
For i = 0 To nbTable - 1
Set Textul = IEDoc.getElementsByTagName("a").Item(i)
lienA = Textul.innerText
lienAdre = Textul
If lienA = "partants/stats/prono" Then
Workbooks(dossier).Sheets(Mafeuill).Cells(n, 1).Value = lienAdre
n = n + 1
End If
Next i
'
End Sub |
Partager