Skip to content

Instantly share code, notes, and snippets.

@ibombonato
Created March 3, 2017 18:31
Show Gist options
  • Save ibombonato/11507d776d1042f80ca59cd31509afd3 to your computer and use it in GitHub Desktop.
Save ibombonato/11507d776d1042f80ca59cd31509afd3 to your computer and use it in GitHub Desktop.
Rvest with fake submit
require(rvest)
#website
url <- ("http://www.anbima.com.br/est_termo/Curva_Zero.asp")
pgsession <- html_session(url)
pgform <-html_form(pgsession)[[1]]
fake_submit <- list("name" = NULL,
"type" = "submit",
"value" = "Submit",
"checked" = NULL,
"disabled" = NULL,
"readonly" = NULL,
"required" = FALSE)
attr(fake_submit, "class") <- "input"
pgform$fields$fake_submit <- fake_submit
param <- set_values(form = pgform,
"escolha" = "2",
"Dt_Ref" = Sys.Date()
)
submit <- submit_form(pgsession, pgform)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment