I'd like to be able to login to a website and save the cookies to a file programmatically. I thought I might be able to do this with {webdriver}
. While I can enter in an email and password, clicking the "Log In" button doesn't seem to do anything.
Here is a reprex:
library(webdriver)
pjs <- run_phantomjs()
ses <- Session$new(port = pjs$port)
ses$go("https://www.draftkings.com/lobby")
el <- ses$findElement(css = "#login-username-input")
el$setValue("email@example.com")
el <- ses$findElement(css = "#login-password-input")
el$setValue("password")
el <- ses$findElement(css = "#login-submit")
el$click()
ses$takeScreenshot()
ses$delete()
I also tried {RSelenium}
but got the same results: could fill in the form but clicking "Log in" didn't work.
I noticed {chromote}
includes a section that discusses logging into a website, but it seems to require manual steps.
Is it possible to use any other R packages to accomplish this in an automated fashion?