Submiting Javascript Form and Scrap with Python -


i have following html/javascript code in website. represents website 2 fields: a) name="n": field mark "v" letter; b) name="id" input number max 8 characters.

<tr>     <td>         <form name="form" method="post" action="javascript:buscar(document.form.n.value, document.form.id.value)"> <table class="aux">     <tr>         <td>             <select name="n" class="form">             <option value="v">v</option>             </select>         </td>         <td>             <input name="id" type="text" class="form"  maxlength="8" size="8" value="id" onfocus="javascript:clear_textbox3();" onblur="javascript:valid(document.form.id);"/>         </td>     </tr>     <tr>         <td>             <input type="submit" value="buscar" class="boton"/>         </td>     </tr>     </table>     </form> </td> 

i have done webscrapers beautifulsoup , urllib before. idea produce script inputs , submits these id numbers (from huge database), , retrieves data website responds (it returns html).

however, can't find form "leads" to. mean, how input? how "press" submit in python?

on posts, php url submitting form leads. can change id in php.?n=v,id=x , "brute force" different numbers. yet cannot find url in website. do?

the original website http://www.cne.gob.ve/web/index.php on right side says "consulte sus datos. proceso de validación y exclusión de registros presentados por el partido mud." , box presents search buttom.

thank all!

it simple request, passing 2 params:

enter image description here

so requests:

url = "http://www.cne.gob.ve/web/registro_electoral/firmantes.php"  params = {"nacionalidad":"v", "cedula":"12345678"}  page = requests.get(url, params=params) print(page.content) 

if pass correct id table of data returned, using 12345678 see table returned , esta cédula de identidad no se encuentra en la base de datos de los registros presentados por el partido mud not valid id.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -