I am trying to access this page: https://www.optionslam.com/accounts/login/ , using the code on this post as a starting point, Clear the website with password protection in R
I was able to fill in the login fields, but I canβt click the login button. If you look at the source of the page, the login class is the "red button"
<input type="submit" value="Log in" class="red-button"/>
However, at the top of the page there is another form that also uses the same class, and clicks the clickElement () button on it. Reading the RSelenium documentation, I cannot find a way to search for a second instance of this class or search for it based on type = "submit" or value = "Log In".
Here is my code:
library(RSelenium) pJS <- phantom() # start phantomjs appURL <- 'https://www.optionslam.com/accounts/login/' remDr <- remoteDriver(browserName = "phantomjs") remDr$open() remDr$navigate(appURL) remDr$findElement("id", "id_username")$sendKeysToElement(list("user")) remDr$findElement("id", "id_password")$sendKeysToElement(list("pass")) remDr$findElement("class name", "red-button")$clickElement()
Thank you for your help.
source share