J'ai décidé de faire un nouveau sujet, car celui là, même s'il s'agit du même lien, est un problème différent...
Je cherche avant tout à cocher une simple checkbox, sur une page web, via IE...
Et j'ai lu qu'il fallait utiliser cette commande : _IEFormElementCheckBoxSelect
-> https://www.autoitscript.fr/autoit3/doc ... Select.htm
Je n'y arrive pas...
Voici le code :
#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 615, 437, 192, 124)
GUICtrlCreateLabel("ID", 5, 7.5, 25, 20)
$inputID = GUICtrlCreateInput("", 35, 5, 200, 20)
GUICtrlCreateLabel("MDP", 5, 32.5, 30, 20)
$inputMDP = GUICtrlCreateInput("", 35, 30, 200, 20)
$run_ie = GUICtrlCreateButton("Lancement IE", 5, 65, 120, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $run_ie
$ID = GUICtrlRead($inputID)
$MDP = GUICtrlRead($inputMDP)
ProcessClose("iexplore.exe")
$ClearID = "255"
RunWait("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess " & $ClearID)
$liens = ""
$oIE = _IECreate("https://www.leboncoin.fr/compte/part/mes-annonces/", 0, 1, 1)
$hWnd = _IEPropertyGet($oIE, "hwnd")
WinSetState($hWnd, "", @SW_MAXIMIZE)
$mail_lbc = _IEGetObjByName($oIE, "email")
$mdp_lbc = _IEGetObjByName($oIE, "password")
_IEPropertySet($mail_lbc, "innertext", $ID)
_IEPropertySet($mdp_lbc, "innertext", $MDP)
Local $btns = _IETagNameGetCollection($oIE, "button")
Local $sTxt = ""
For $btn In $btns
$sTxt &= $btn.type & "---" & $btn.innertext & @CRLF
If $btn.innertext = "Se connecter" Then _IEAction($btn, "click")
Next
_IELoadWait($oIE)
Sleep(2000)
$oIE.document.parentwindow.scroll(0, @DesktopHeight * 1000)
$oIE.document.body.scroll = "NO"
;~ Local $chks = _IETagNameGetCollection($oIE, "checkbox")
;~ Local $sTxt = ""
;~ For $chk In $chks
;~ $sTxt &= $chk.type & "---" & $chk.innertext & @CRLF
;~ If $chk.innertext = "checkbox" Then _IEAction($chk, "click")
;~ Next
$oForm = _IEFormGetCollection($oIE, 0)
_IEFormElementCheckBoxSelect($oForm, "on", "", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "checkbox", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "TAYdd", 1, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "on", "", 0, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "", "", 1, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "", "", 0, "byValue")
;~ <div class="_1R1eo"><input class="TAYdd" type="checkbox" value="on"></div>
EndSwitch
WEnd
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 615, 437, 192, 124)
GUICtrlCreateLabel("ID", 5, 7.5, 25, 20)
$inputID = GUICtrlCreateInput("", 35, 5, 200, 20)
GUICtrlCreateLabel("MDP", 5, 32.5, 30, 20)
$inputMDP = GUICtrlCreateInput("", 35, 30, 200, 20)
$run_ie = GUICtrlCreateButton("Lancement IE", 5, 65, 120, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $run_ie
$ID = GUICtrlRead($inputID)
$MDP = GUICtrlRead($inputMDP)
ProcessClose("iexplore.exe")
$ClearID = "255"
RunWait("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess " & $ClearID)
$liens = ""
$oIE = _IECreate("https://www.leboncoin.fr/compte/part/mes-annonces/", 0, 1, 1)
$hWnd = _IEPropertyGet($oIE, "hwnd")
WinSetState($hWnd, "", @SW_MAXIMIZE)
$mail_lbc = _IEGetObjByName($oIE, "email")
$mdp_lbc = _IEGetObjByName($oIE, "password")
_IEPropertySet($mail_lbc, "innertext", $ID)
_IEPropertySet($mdp_lbc, "innertext", $MDP)
Local $btns = _IETagNameGetCollection($oIE, "button")
Local $sTxt = ""
For $btn In $btns
$sTxt &= $btn.type & "---" & $btn.innertext & @CRLF
If $btn.innertext = "Se connecter" Then _IEAction($btn, "click")
Next
_IELoadWait($oIE)
Sleep(2000)
$oIE.document.parentwindow.scroll(0, @DesktopHeight * 1000)
$oIE.document.body.scroll = "NO"
;~ Local $chks = _IETagNameGetCollection($oIE, "checkbox")
;~ Local $sTxt = ""
;~ For $chk In $chks
;~ $sTxt &= $chk.type & "---" & $chk.innertext & @CRLF
;~ If $chk.innertext = "checkbox" Then _IEAction($chk, "click")
;~ Next
$oForm = _IEFormGetCollection($oIE, 0)
_IEFormElementCheckBoxSelect($oForm, "on", "", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "checkbox", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "TAYdd", 1, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "on", "", 0, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "", "", 1, "byValue")
;~ _IEFormElementCheckBoxSelect($oForm, "", "", 0, "byValue")
;~ <div class="_1R1eo"><input class="TAYdd" type="checkbox" value="on"></div>
EndSwitch
WEnd
$oForm = _IEFormGetCollection($oIE, 0)
_IEFormElementCheckBoxSelect($oForm, "on", "", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "checkbox", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "TAYdd", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "checkbox", 1, "byValue")
_IEFormElementCheckBoxSelect($oForm, "on", "TAYdd", 1, "byValue")
Et j'avais obtenu cela :
Code : Tout sélectionner
<div class="_1R1eo"><input class="TAYdd" type="checkbox" value="on"></div>
A mon avis, c'est simple... mais pas pour moi.
Où ai-je fauté ?
Merci

PS : j'ai créé ce nouveau sujet afin de dissocier le sujet de départ, car il va surement me servir pour d'autres projets.
++