You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fill the web form in this website using html_form, html_form_set and html_form_submit. This does not work due to the way submission_build function fills the checkboxes. The form below should be filled correct and return a table but it returns an error page instead due to some checkboxes being marked erroneously.
Minimal example:
httr::set_config(httr::config(ssl_verifypeer=0L))
session=rvest::session('https://www.flyrnai.org/cgi-bin/DRSC_orthologs.pl')
form=rvest::html_form(session)[[1]]
form=rvest::html_form_set(form,
input_species=9606,
output_species=10090,
gene_list="GZMH")
response=rvest::html_form_submit(form,submit='submit')
# the results will be missing hereresponse %>%
xml2::read_html() %>%
rvest::html_node('#results')
# debugging ---
writeLines(as.character(session$response),'page.html')
utils::browseURL('page.html')
writeBin(response$content,'response.html')
utils::browseURL('response.html')
Examining the session and response outputs above we will see that all the checkboxes are checked during the submission process
Examining the root cause of the issue I find that it is the way submission_build function handles these checkboxes
Looking within html_form_submit It seems like it uses the pair, submission_build and submission_submit functions to do it's work and submission_build function simply extracts the value object from the form form fields and send them off the be checked. However the actual information about the state of these fields are stored elsewhere in the attr. For example
I am trying to fill the web form in this website using
html_form
,html_form_set
andhtml_form_submit
. This does not work due to the waysubmission_build
function fills the checkboxes. The form below should be filled correct and return a table but it returns an error page instead due to some checkboxes being marked erroneously.Minimal example:
Examining the
session
andresponse
outputs above we will see that all the checkboxes are checked during the submission processExamining the root cause of the issue I find that it is the way
submission_build
function handles these checkboxesLooking within
html_form_submit
It seems like it uses the pair,submission_build
andsubmission_submit
functions to do it's work andsubmission_build
function simply extracts thevalue
object from the form form fields and send them off the be checked. However the actual information about the state of these fields are stored elsewhere in theattr
. For exampleThe text was updated successfully, but these errors were encountered: