I would like to use this code with a headless browser (e.g. phantomjs or casperjs) and then download the csv file at the end (instead of the native browser's saver popup dialog).
library("RSelenium")
startServer()
mybrowser <- remoteDriver(browserName = 'chrome')
mybrowser$open()
mybrowser$navigate("http://steamspy.com/login/")
wxbox <- mybrowser$findElement(using = 'xpath', "//*/input[@name = 'username']")
wxbox$sendKeysToElement(list("myusername"))
wxbox <- mybrowser$findElement(using = 'xpath', "//*/input[@name = 'password']")
wxbox$sendKeysToElement(list("mypassword"))
wxbutton <- mybrowser$findElement(using = 'xpath', "//*/button[@name = 'submit']")
wxbutton$clickElement()
mybrowser$navigate("http://steamspy.com/sale.php?tagid=0&from=2015-04-01&to=2016-04-25&submit=")
wxbutton <- mybrowser$findElement(using = 'css selector', "#ToolTables_tablesales_0")
wxbutton$clickElement()
Simply by changing chrome
with phantomjs
leads to this following error at opening and navigating the page:
Error: Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
class: org.openqa.selenium.UnsupportedCommandException