1

I'm totally brand new to HTML and webscraping, so apologies if I've completely misinterpreted the problem here.

I followed various StackOverflow posts on logging into websites with rvest and had success, but I'm having trouble applying the same technique to this particular website.

Code:

url <- "https://www.architecturaldigest.com/account/sign-in"
session <- html_session(url)
myforms <- html_form(session)

Instead of a collection of forms I can manipulate, myforms is empty.

I just can't figure out the proper way to interact with this login page. I'd love some guidance on how to approach this, or even what terminology to use when Googling for answers--does this site really lack HTML forms? What's it using instead?

1 Answers1

0

You can consider using the following approach :

library(RSelenium)

shell('docker run -d -p 4446:4444 selenium/standalone-firefox')
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4446L, browserName = "firefox")
url <- "https://www.architecturaldigest.com/account/sign-in"
remDr$open()
remDr$navigate(url)

web_Obj_Username <- remDr$findElement("xpath", "/html/body/div[1]/div/main/div/div[1]/div/form/div[1]/span/label/div[2]/input")
web_Obj_Username$sendKeysToElement(list("allo.jol@gmail.com"))

web_Obj_Password <- remDr$findElement("xpath", "/html/body/div[1]/div/main/div/div[1]/div/form/div[1]/div/span/label/div[2]/input")
web_Obj_Password$sendKeysToElement(list("my_password"))

web_Obj_Login <- remDr$findElement("xpath", "/html/body/div[1]/div/main/div/div[1]/div/form/button[1]")
web_Obj_Login$clickElement()
Emmanuel Hamel
  • 1,769
  • 7
  • 19