htmlunit - Get a non-id form with HTML-UNIT C# -


so i've got htmlpage 2 forms in it, not 1 of have id get.

i've tried them getting last child on body (which form need get), i've been trying receive on htmlform element, no luck. ideas?

edit: i'm adding part of code can see :(

                <table width="650" bordercolor="#cccccc" bgcolor="white" border="1">                     <tbody>                         <tr>                             <th>                                 <font size="1">accion </font>                             </th>                             <th>                                 <font size="1">estado </font>                             </th>                             <th>                                 <font size="1">descripcion </font>                             </th>                             <th>                                 <font size="1">cantidad </font>                             </th>                         </tr>                         <form action="le_02pre_deim_anticipada.asp?submit=aa" method="post"></form>                         <input name="cod_estado" type="hidden" value="100">                         <input name="descrip" type="hidden" value="100">                         <input name="buzon" type="hidden" value="b1_">                         <input name="filtro_fecha" type="hidden" value="1">                         <tr>                             <td width="20%" align="center">                                 <input name="submit" type="submit" value="seleccionar"></td>                             <td width="10%" align="center">                                 <font size="2">100</font>                             </td>                             <td width="60%">                                 <font size="2">                                     informadas en espera de la presentaciĆ³n en bancos                                 </font>                             </td>                             <td width="10%" align="center">                                 <font size="2">233</font>                             </td>                         </tr>                         <form action="le_02pre_deim_anticipada.asp?submit=aa" method="post"></form>                         <input name="cod_estado" type="hidden" value="200">                         <input name="descrip" type="hidden" value="200">                         <input name="buzon" type="hidden" value="b2_">                         <input name="filtro_fecha" type="hidden" value="1">                         <tr>                             <td width="20%" align="center" bgcolor="#cccccc">                                 <input name="submit" type="submit" value="seleccionar"></td>                             <td width="10%" align="center" bgcolor="#cccccc">                                 <font size="2">200</font>                             </td>                             <td width="60%" bgcolor="#cccccc">                                 <font size="2">                                     presentadas en entidades recaudadoras en espera de la solicitud de levante                                 </font>                             </td>                             <td width="10%" align="center" bgcolor="#cccccc">                                 <font size="2">194</font>                             </td>                         </tr>                     </tbody>                 </table> 

so need send values through post.

<input name="cod_estado" type="hidden" value="200"> <input name="descrip" type="hidden" value="200"> <input name="buzon" type="hidden" value="b2_"> <input name="filtro_fecha" type="hidden" value="1"> 

i'm receiving body on:

htmlbody body0 = (htmlbody)p0.body; 

i solved :d

i wanted let know how solved issue. not 1 element on page has id, can use position of markers navigate it.

htmlform f02submit = pagedecla.forms[1]; htmlsubmitinput subm02 = (htmlsubmitinput)pagedecla.getelementsbyname("submit")[1]; f02submit.appendchild(subm02); var count = f02submit.childelementcount; subm02 = (htmlsubmitinput)f02submit.childnodes[count-1]; paginadecla = (htmlpage)subm02.click(); f02submit = null; subm02 = null; int f = 0, hfimp = 0; f = paginadecla.forms.count;   (int = 0; < f; i++) {     var form = pagedecla.forms[i];     hfimp = form.childelementcount;     subm02 = (htmlsubmitinput)pagedecla.getelementsbyname("submit")[i];     (int j = 0; j < hfimp; j++)     {                             var hfi = (htmlhiddeninput)form.childnodes[j];         var namehf = hfi.nameattribute;         var val = hfi.valueattribute;         if ((val == cod_int) && (namehf == name))         {             form.appendchild(subm02);             hfimp = form.childelementcount;             var btn = (htmlsubmitinput)form.childnodes[hfimp-1];             pagedecla = (htmlpage)btn.click();             j = hfimp;             = f;         }       } } 

thanks tried, know did not provide information.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -