Simulate a session in an html browser.
html_session(url, ...) is.session(x)
| url | Location to start session |
|---|---|
| ... | Any additional httr config to use throughout session. |
| x | An object to test to see if it's a session. |
A session object responds to a combination of httr and html methods:
use httr::cookies(), httr::headers(),
and httr::status_code() to access properties of the request;
and html_nodes() to access the html.
# http://stackoverflow.com/questions/15853204 s <- html_session("http://hadley.nz") s %>% jump_to("hadley-wickham.jpg") %>% jump_to("/") %>% session_history()#> http://hadley.nz/ #> http://hadley.nz/hadley-wickham.jpg #> - http://hadley.nz/#> - http://hadley.nz/ #> http://hadley.nz/hadley-wickham.jpg#>#> <session> https://rstudio.com/ #> Status: 200 #> Type: text/html; charset=UTF-8 #> Size: 72787# }