Sub testJP()
Dim driver As WebDriver
Dim LeftFrame As WebElement, Lien As WebElement
Dim Championnat As WebElement, NumEquipe As WebElement, NumJoueur As WebElement
Dim btnConsult As WebElement, btnValider As WebElement, Res As WebElement
Dim i As Long, Infos() As String
Set driver = New WebDriver
driver.Edge "D:\OneDrive\Bureau\webdriver\msedgedriver.exe"
driver.OpenBrowser
driver.SetTimeouts 30000, 30000, 10000
driver.NavigateTo "https://www.exemple.com"
driver.MaximizeWindow
Set LeftFrame = driver.FindElement(name, "leftframe")
driver.SwitchToFrame LeftFrame
Set Lien = driver.FindElement(ID, "M21")
Lien.Click
Set btnConsult = driver.FindElement(ID, "A9")
btnConsult.Click
Set Championnat = driver.FindElement(ID, "A1")
Set NumJoueur = driver.FindElement(ID, "A2")
Set NumEquipe = driver.FindElement(ID, "A3")
Set btnValider = driver.FindElement(ID, "A4")
Set Res = driver.FindElement(ID, "tzA5")
Championnat.SendKeys "Indiv"
On Error Resume Next
For i = 1 To 200
NumJoueur.Clear
NumJoueur.SendKeys CStr(Cells(i, 1).value)
btnValider.Click
If InStr(1, Res.GetText, "%1") Then
Debug.Print CStr(NumJoueur.GetProperty("value")), " : ", " - "
Else
Infos = Split(Res.GetText, vbCrLf)
Debug.Print CStr(NumJoueur.GetProperty("value")) + " : " + _
Infos(0) + " -> " + Infos(1)
End If
Next i
On Error GoTo 0
Application.Wait Now() + TimeValue("00:00:2")
driver.MinimizeWindow
driver.CloseBrowser
driver.Quit
Set driver = Nothing
End Sub