Bash 是否可以自动登录roblox?

Bash 是否可以自动登录roblox?,bash,Bash,我最近一直在玩roblox,我想知道是否有一种方法可以自动登录,因为我每次都在不同的电脑上玩。我研究了Python的selenium,并导出了脚本: from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.roblox.com/login") usernameStr = '<redacted>' passwordStr = '<redacted>

我最近一直在玩roblox,我想知道是否有一种方法可以自动登录,因为我每次都在不同的电脑上玩。我研究了Python的selenium,并导出了脚本:

from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.roblox.com/login")
usernameStr = '<redacted>'
passwordStr = '<redacted>'
username = driver.find_element_by_id('login-username')
username.send_keys(usernameStr)
password = driver.find_element_by_id('login-password')
password.send_keys(passwordStr)
signInButton = driver.find_element_by_id('login-button')
signInButton.click()
从selenium导入webdriver
driver=webdriver.Chrome()
驱动程序。获取(“https://www.roblox.com/login")
usernameStr=''
passwordStr=''
用户名=驱动程序。通过\u id(“login-username”)查找\u元素\u
用户名。发送密钥(usernameStr)
password=驱动程序。通过\u id('login-password')查找\u元素
密码。发送密钥(passwordStr)
signInButton=驱动程序。通过\u id(“登录按钮”)查找\u元素
登录按钮。单击()

当我在VScode中运行它时,它工作得非常好,但是当我导出python文件并尝试通过解释器运行它时,它在版本类型方面出现了许多错误。我也在计算机上安装了
selenium
。我的假设是,我的本地计算机在后台有一些工具,而我在其他计算机上尝试时却没有。当我去我的另一台电脑时,有什么东西我遗漏了吗?我正在使用python3.8。

当python在您的
$PATH
中运行时,您可以制作一个脚本

#!/usr/bin/env python
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.roblox.com/login")
usernameStr = '<redacted>'
passwordStr = '<redacted>'
username = driver.find_element_by_id('login-username')
username.send_keys(usernameStr)
password = driver.find_element_by_id('login-password')
password.send_keys(passwordStr)
signInButton = driver.find_element_by_id('login-button')
signInButton.click()
#/usr/bin/env python
从selenium导入webdriver
driver=webdriver.Chrome()
驱动程序。获取(“https://www.roblox.com/login")
usernameStr=''
passwordStr=''
用户名=驱动程序。通过\u id(“login-username”)查找\u元素\u
用户名。发送密钥(usernameStr)
password=驱动程序。通过\u id('login-password')查找\u元素
密码。发送密钥(passwordStr)
signInButton=驱动程序。通过\u id(“登录按钮”)查找\u元素
登录按钮。单击()

如果您将此文件保存在终端中并运行
chmod+x
以授予其可执行权限,则它将是一个可执行文件,您可以从计算机中移动它。确保还安装了所有其他selenium依赖项。使用selenium时,请确保您的chrome驱动程序与您的chrome浏览器相同,您可以阅读相关内容。

感谢您的解释,它确实很有帮助。