Created
March 3, 2017 18:31
-
-
Save ibombonato/11507d776d1042f80ca59cd31509afd3 to your computer and use it in GitHub Desktop.
Rvest with fake submit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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