如何在Windows机器上使用RSelum登录网站 [英] How to use RSelenium to Login to a Website on Windows machine

查看:0
本文介绍了如何在Windows机器上使用RSelum登录网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

原问题:在Windows计算机上查看docker映像机密
我在没有停靠站的情况下得到解决方案时更新了问题

我正在跟踪RSelenium tutorial,当我尝试使用Tack VNC登录到容器时被卡住。

我需要获取镜像密码,但我被告知要运行的命令对我(Windows计算机)来说有点陌生

RUN apt-get update -qqy 
  && apt-get -qqy install 
    x11vnc 
  && rm -rf /var/lib/apt/lists/* 
  && mkdir -p ~/.vnc 
&& x11vnc -storepasswd secret ~/.vnc/passwd

作为背景,我的实际目标是使用R登录一个网站并获取一些数据。这让我想到了RSelum,它需要Docker。

在chinsoon12的大力帮助下解决
此解决方案绕过了需要使用Docker的问题,只允许我通过RSelum访问浏览器

#Install firefox
#Download geckodriver and unzip the exe here c:ingeckodriver
#start Selenium server by opening a command prompt and then type
#cd ~YOUR_R_PATH~libraryRSeleniumin
#Download selenium server into the above location http://www.seleniumhq.org/download/ 
#java -jar selenium-server-standalone-x.xx.x.jar

remDr <- remoteDriver()
remDr$open()

remDr$navigate("https://www2.commsec.com.au/Public/HomePage/Login.aspx")

#send username
username <- remDr$findElement(using = "id", value = "ct100_cpContent_txtLogin")
username$clearElement()
username$sendKeysToElement(list("My_User_Name"))

#send password and Enter
passwd <- remDr$findElement(using = "id", value = "ct100_cpContent_fakepassword")
passwd$clearElement()
passwd$sendKeysToElement(list("My_Password", "uE007"))

推荐答案

您可以尝试以下方法。让我知道哪个步骤失败了以及错误消息。我会尽力帮忙的。

#start Selenium server by opening a command prompt and then type
#cd ~YOUR_R_PATH~libraryRSeleniumin
#java -jar selenium-server-standalone-x.xx.x.jar

remDr <- remoteDriver()
remDr$open()

remDr$navigate("https://www2.commsec.com.au/Public/HomePage/Login.aspx")

#send username
username <- remDr$findElement(using = "id", value = "ct100_cpContent_txtLogin")
username$sendKeysToElement(list("My_User_Name"))

#send password and Enter
passwd <- remDr$findElement(using = "id", value = "ct100_cpContent_fakepassword")
passwd$sendKeysToElement(list("My_Password", "uE007"))

这篇关于如何在Windows机器上使用RSelum登录网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆