Seems like you probably want rvest::html_table
:
library(rvest)
content(resp) %>%
html_table() %>%
`[[`(1)
## A tibble: 370 x 8
# CUSIP `SECURITY TYPE` RATE `MATURITY DATE` `CALL DATE` BUY SELL `END OF DAY`
# <chr> <chr> <chr> <chr> <lgl> <dbl> <dbl> <dbl>
# 1 912796EK1 MARKET BASED BILL 0.000% 12/18/2014 NA 0 100. 100.
# 2 912796EL9 MARKET BASED BILL 0.000% 12/26/2014 NA 100. 100. 100.
# 3 912796EM7 MARKET BASED BILL 0.000% 01/02/2015 NA 100. 100. 100.
# 4 912796DF3 MARKET BASED BILL 0.000% 01/08/2015 NA 100 100 100.
# 5 912796EP0 MARKET BASED BILL 0.000% 01/15/2015 NA 100. 100. 100.
# 6 912796EQ8 MARKET BASED BILL 0.000% 01/22/2015 NA 100 100 100.
# 7 912796ER6 MARKET BASED BILL 0.000% 01/29/2015 NA 100 100 100.
# 8 912796DG1 MARKET BASED BILL 0.000% 02/05/2015 NA 100 100 100.
# 9 912796EU9 MARKET BASED BILL 0.000% 02/12/2015 NA 100. 100. 100.
#10 912796EV7 MARKET BASED BILL 0.000% 02/19/2015 NA 100. 100. 100.
## … with 360 more rows
From the linked question for clarity:
library(httr)
url <- "https://www.treasurydirect.gov/GA-FI/FedInvest/selectSecurityPriceDate.htm"
fd <- list(
submit = "Show Prices",
priceDate.year = 2014,
priceDate.month = 12,
priceDate.day = 15
)
resp<-POST(url, body=fd, encode="form")