Hi, guys!
I have been trying to do a web scraping from a page, but I'm lost.
I need, first to do a login and than scrap the information.
How can I acess the form and fill it with rvest, httr or JSONlite?
Part of the HTML:
<form class="_ab3b" id="loginForm" method="post">
....
<input aria-label="Telefone, nome de usuário ou email" aria-required="true" autocapitalize="none" autocorrect="off" maxlength="75" name="username" type="text" class="_aa4b _add6 _ac4d" value="username">
....
<input aria-label="Senha" aria-required="true" autocapitalize="none" autocorrect="off" name="password" type="password" class="_aa4b _add6 _ac4d" value="password">
I have been trying something like:
url <- "https://www.EXAMPLE.com/accounts/login/"
session <- rvest::html_session(url)
form <-
rvest::read_html(url) |>
rvest::html_element("body") |>
rvest::html_form("form")
filled_form <- rvest::set_values(form,
username = "notmyrealemail",
password = "notmyrealpassword")
rvest::submit_form(session, filled_form)
player_page <- rvest::jump_to(page,
"https://www.EXAMPLE.com/profile/?__a=1&__d=11")
But I can't pass the form
part.