capm
capm

Reputation: 1047

Scraping ASP website with arguments

I have a website from which I want to download an XLS file. The site has 3 filters, start date, final date and currency. I checked the source code and the final step before downloading the XLS:

<td width="142" valign="top" >
  <!--onClick="return validar_fechas();"-->
  <input name="Consultar" type="submit" id="Consultar"  class="APLI_boton" value="Consultar" onClick="return validar_fechas();"></td>
<td width="476">
  &nbsp;&nbsp; <a href="Vector_Lista_historica.asp?fec_cons=&fec_cons2=&tip_cur=" target="_blank"></a>
</td>

In the last line it seems to call some arguments like date and currency, however when I try to use this website to download the XLS without entering the dates manually it gives me an empty XLS file.

The urls I've tried are:

http://www.sbs.gob.pe/app/pp/vectorprecios/Vector_Lista_historica.asp?fec_cons="04/03/2016"&fec_cons2="04/03/2016"&tip_cur="x" http://www.sbs.gob.pe/app/pp/vectorprecios/Vector_Lista_historica.asp?"04/03/2016"&"04/03/2016"&"x"

But none of them gave me the XLS file needed.

What am I missing?

Upvotes: 0

Views: 37

Answers (1)

Dr. Cool
Dr. Cool

Reputation: 3721

Try this: www.sbs.gob.pe/app/pp/vectorprecios/Vector_Lista_historica.asp?as_fec_cons=04/03/2016&as_fec_cons2=04/03/2016&as_tip_curva=x

You were close but a couple things were wrong. First, don't use quotation marks. Second, the names of the attributes weren't quite right. After adjusting those two things, it works.

Upvotes: 1

Related Questions