All,
I was getting data swap rate data from the St. Louis Fed FRED database via the
FRED API. ICE stopped reporting to FRED and now I must get the data from the
ICE website. I would like to use httr to get the data but I really don't know
much about website design. I think the form redirects but I am not sure that
is the case much less how to identify what website the form redirects to. I
used the developer and inspect elements to come up with the below which failed
miserably. In addition, I purchase the book Automated Data Collection with R
which has not been to useful helping me to understand how to navigate pages
using forms and redirects.
Can anyone provide a good reference to understanding how to get data from
websites using forms and redirects. Specifically,
How find the actual webpage that on must submit the POST request.
How to the find the redirected page which really has the data.
Best,
Glenn
library(httr)
#get initial cookies
h <- handle("https://www.theice.com/")
GET(handle = h)
POST(url = "https://www.theice.com/marketdata/reports/180",
body = list(reportDate = "15-Dec-2016",
SeriesNameAnRunCode_chosen = "USD Rates 1100"),
encode = "form",
handle = h)
page <- GET(url= "https://www.theice.com/marketdata/reports/icebenchmarkadmin/ISDAFIXHistoricalRates.shtml",
handle = h)
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.