【发布时间】:2017-04-28 20:05:53
【问题描述】:
我想使用来自http://finra-markets.morningstar.com/BondCenter/TRACEMarketAggregateStats.jsp 的 rvest 提取下表(对于任何日期):
我尝试了以下方法,但没有产生任何结果:
library(rvest)
url <- "http://finra-markets.morningstar.com/BondCenter/TRACEMarketAggregateStats.jsp"
htmlSession <-html_session(url) ## create session
goForm <- html_form(htmlSession)[[2]] ## pull form from session
#filledGoForm <- set_values(goForm, value="04/26/2017") # This does not work
filledGoForm <- goForm
filledGoForm$fields[[1]]$value <- "04/26/2017"
htmlSession <- submit_form(htmlSession, filledGoForm)
> htmlSession <- submit_form(htmlSession, filledGoForm)
Submitting with ''
Warning message:
In request_POST(session, url = url, body = request$values, encode = request$encode, :
Not Found (HTTP 404).
任何关于如何做到这一点的提示都非常感谢。
【问题讨论】:
标签: r web-scraping rvest