Problème de Option Select
:salut: et Bonjour à Tous !
voila j'ai fais ce script pour se connecter automatiquement mais hélas je suis un peu coincé dans la ligne ou je veux récupérer la 2ème Option de Select
càd la valeur CNRPS. je veux que le script se pointe automatiquement sur cette option puis il continue sur submit pour terminer la requête.
Voici la Partie HTML
Code:
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
| <tr >
<td colspan="2" align="left"><font size="2"><strong><font color="#666666" > Matricule
:</font></strong></font></td>
<td><div align="left">
<input name="txt_matricule" type="text" id="txt_matricule" size="15" maxlength="10" />
</div></td>
</tr>
<tr>
<td height="26" colspan="3" align="left"><font color="#990000"><strong>Ex
de matricule :65310101</strong></font></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="17%" height="30" align="left"><font size="2"><strong><font color="#666666">Mot
de passe :</font></strong></font></td>
<td width="36%" height="30"> </td>
<td><div align="left">
<input name="txt_matricule2" type="password" id="txt_matricule2" size="15" maxlength="12" />
</div></td>
</tr>
<tr>
<td height="25" colspan="3" align="left"><strong><font color="#990000">Nouveau
mot de passe</font></strong></td>
</tr>
<tr>
<td colspan="2" align="left"><font size="2"><strong><font color="#666666">Caisse :</font></strong></font></td>
<td><div align="right">
<label> </label>
<div align="left">
<select name="caisse" id="caisse">
<option>CNSS</option>
<option>CNRPS</option>
</select>
</div>
</div></td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" name="Submit" value="Connexion" /></td>
</tr> |
Et Voici le code vbscript
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 1
IE.navigate "http://www.cnam.nat.tn/e-cnam/pages/login_assures.jsp"
Do While (IE.Busy)
WScript.Sleep 200
Loop
Set Helem = IE.document.getElementById("txt_matricule")
Helem.Value = "MaMatricule"
Set Helem = IE.document.getElementById("txt_matricule2")
Helem.Value = "MonPass"
Set Helem = iE.document.getElementsByName("caisse")
hElem(1).Status=1 'je veux récuperer la 2ème càd la valeur CNRPS ????
Set Helem = IE.document.getElementByName("Submit")
Helem.Click |
:merci: