Taking this example form:
require(rvest)
ses <- html_session("https://www.handelsregister.de/rp_web/mask.do?Typ=e")
form <- ses %>% html_form() %>% .[[1]]
submit_form(ses, form, submit = 'foo')
submit_form exits with the error
Error: Unknown submission name 'foo'.
Possible values: bundeslandTH, schlagwortOptionen, ort
Looking at the form all three "Possible values" are no submit-buttons:
<input checkbox> 'bundeslandTH':
<input radio> 'schlagwortOptionen':
<input text> 'ort':
digging into submit_form and submit_request it turns out that there are form$fields that do not have a form$fields$type.
rvest:::submit_request reads as follows:
is_submit <- function(x) tolower(x$type) %in% c("submit",
"image", "button")
submits <- Filter(is_submit, form$fields)
if (length(submits) == 0) {
stop("Could not find possible submission target.", call. = FALSE)
}
...
As the form$fields$type is missing is_submit returns logical(0) which is not at all handled by Filter
Taking this example form:
submit_formexits with the errorLooking at the form all three "Possible values" are no submit-buttons:
digging into
submit_formandsubmit_requestit turns out that there areform$fieldsthat do not have aform$fields$type.rvest:::submit_requestreads as follows:As the
form$fields$typeis missingis_submitreturnslogical(0)which is not at all handled byFilter