I am trying to log in in stackoverflow and navigating on the search bar, searching by tidyverse package.
The main problem is when I set the url, which is not giving me the form to fill with my email and my password:
So url<-"https://stackoverflow.com"
doesnt work. I tried the url: url<-"https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2f"
which is the url that I have when I click on the the Log in bottom, but I also can't find the form to fill with my email and password when using html_form
. This is my code:
library(rvest)
url<-"https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2f"
(session <- html_session(url))
(form <- html_form(read_html(url))[[1]])
(filled_form <- set_values(form,email="myemail@gmail.com",pass="mypassword"))
(form_submitted<-submit_form(session,filled_form))
(submitted_url<-form_submitted$url)
after_filled_html<-jump_to(session,submitted_url)
And after this, I would like to do a search by the term: [tidyverse]
and start scraping it.
I think this second part I will be able to manage if I solve the problem of the code above if I fix the login/password/form problem.
Any help guys