File download from form completion

3

I'm trying to access a website, fill out your form and download the file, but I'm encountering some difficulties.

This is my code so far:

#library's
require(rvest)

#website
url <- ("http://www.anbima.com.br/est_termo/Curva_Zero.asp")
pgsession <- html_session(url)
pgform <-html_form(pgsession)[[1]]
param <- set_values(pgform, 
        "escolha" = "2",
        "Dt_Ref" = Sys.Date()
)

submit <- submit_form(pgsession, form = param, "Consultar")

But it returns an error submitting the submit: Erro: Could not find possible submission target.

Can anyone help me?

    
asked by anonymous 02.03.2017 / 19:18

1 answer

0

As discussed with the friend above, it was much easier than imagined the result:

download.file("http://www.anbima.com.br/est_termo/CZ-down.asp", 
destfile = "")
    
03.03.2017 / 22:48