0

I am trying to scrap some information from the following web page and for that I am using beautifulsoup without any problem:

http://www.camara.gov.br/internet/votacao/default.asp

However I need information from all months and by looking at the source it has the following:

<select name="selOutrasDatas" id="selOutrasDatas" onChange="javascript:if (this.selectedIndex != -1) { frmOutroMes.OutroMes.value=this.options[this.selectedIndex].value ; frmOutroMes.submit() } else { alert('Voc&ecirc; n&atilde;o efetuou uma escolha v&aacute;lida.') }" style="width:16em"> 
                        <option  value="01/8/2015">2015/Agosto</option> 
                        <option  SELECTED  value="01/7/2015">2015/Julho</option> 
                        <option  value="01/6/2015">2015/Junho</option> 
                        <option  value="01/5/2015">2015/Maio</option> 

As you can see the only difference when changing month by clicking on the webpage is the word SELECTED in tag "option" but the webpage url continues being the same for every month. How could I program in python so that I can go month by month?

1 Answer 1

1

You need to retrieve page over POST request with date as OutroMes field: {"OutroMes":"01/7/2015"} (thats what javascript do when you select date in select) Python: How to send POST request?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.