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?

user2246905
  • 1,029
  • 1
  • 12
  • 31

1 Answers1

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?

Community
  • 1
  • 1
mugiseyebrows
  • 4,138
  • 1
  • 14
  • 15