library(rvest)
# Address of the login webpagelogin<-"https://openreview.net/login"# Create a web session with the desired login addresspgsession<- html_session(login)
pgform<- html_form(pgsession)[[2]] #in this case the submit is the 2nd formpgform$fields[[1]]$value<-"****"# replace by emailpgform$fields[[2]]$value<-"***"# replace by password
submit_form(pgsession, pgform)
which results in
Submitting with '<unnamed>'
Error in parse_url(url) : length(url) == 1 is not TRUE
Reading the submit_form function, I noticed that it builds a URL as follows
url <- xml2::url_absolute(form$url, session$url)
Checking the form, I noticed that form$url is NULL, which results in url being NULL, explaining the message length(url) == 1 is not TRUE.
I've tried fiddling with the rvest source code, e.g. editing lines to say
Submitting with '<unnamed>'
Error in ans[npos] <- rep(no, length.out = len)[npos] :
replacement has length zero
In addition: Warning message:
In rep(no, length.out = len) : 'x' is NULL so the result will be NULL
I'm all out of ideas, whether the form doesn't respect standards that rvest expects, or rvest needs some further tweaks to support whatever this form expects./returns.
Thanks in advance for the advice!
The text was updated successfully, but these errors were encountered:
I've started (locally, not on github yet) an R package that uses basilisk / reticulate to wrap Python, but ultimately, I think I'll just write a bit of python ;)
Happy to close the issue, or to leave it open as a sticky note if you want to work on any related aspect of rvest
I've been trying to log in to https://openreview.net/ using
rvest
, following instructions at https://riptutorial.com/r/example/23955/using-rvest-when-login-is-required and https://stackoverflow.com/questions/54132813/rvest-how-to-submit-form-when-input-doesnt-have-a-namewhich results in
Reading the
submit_form
function, I noticed that it builds a URL as followsChecking the form, I noticed that
form$url
isNULL
, which results inurl
beingNULL
, explaining the messagelength(url) == 1 is not TRUE
.I've tried fiddling with the
rvest
source code, e.g. editing lines to saybut the reprex above then produces
I'm all out of ideas, whether the form doesn't respect standards that
rvest
expects, orrvest
needs some further tweaks to support whatever this form expects./returns.Thanks in advance for the advice!
The text was updated successfully, but these errors were encountered: