I'm trying to download [the full] dynamically expanded [holdings] table using rvest, but am getting an Unknown field names
error.
s <- html_session("http://innovatoretfs.com/etf/?ticker=ffty")
f <- html_form(s)[[1]]
#the following line fails:
f.new <- set_values(f, `__EVENTTARGET` = "ctl00$BodyPlaceHolder$ViewHoldingsLinkButton")
##subsequent lines are not tested##
doc <- submit_form(s, f.new)
tabs <- xml_find_all(doc, "//table")
holdings <- html_table(tabs, fill = T, trim = T)[[5]]
I'm not great with HTML/HTTP but from what i can chase through, it seems to me that to expand the table requires a postback of the form with this new field value set
after inspecting the set_values
function, it seems that it only allows existing fields to be assigned values.
is there any way to add a new field to a form under rvest
? If not, is anyone ware of another package I could use to get this functionality?
[edited] to be very explicit that i need the full version of the dynamically expanded table and to add expected subsequent table extraction code