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
|
Sub RechercheNom()
'Déclaration des variables
Dim Ie As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim InputGoogleZoneTexte As HTMLInputElement
Dim InputGoogleBouton As HTMLInputElement
'Chargement d'une page Web piano
Ie.navigate "http:/xxxx"
'Affichage de la fenêtre IE
Ie.Visible = True
'On attend le chargement complet de la page
WaitIE Ie
'On pointe le membre Document
Set IEDoc = Ie.document
'On pointe notre Zone de texte
Set InputGoogleZoneTexte = IEDoc.all("txt_Nom")
'On définit le texte que l'on souhaite placer à l'intérieur
InputGoogleZoneTexte.Value = "nomxxx"
'On pointe notre bouton
Set InputGoogleBouton = IEDoc.all("btn_Filter")
'On simule un clic
InputGoogleBouton.Click
'On attend la fin de la recherche
WaitIE Ie
'On libère les variables
Set Ie = Nothing
Set IEDoc = Nothing
End Sub
'-------------------------------------------------------------------------------
Sub WaitIE(Ie As InternetExplorer)
'On boucle tant que la page n'est pas totalement chargée
Do: DoEvents: Loop While Ie.Busy Or Ie.readyState <> 4 |
Partager