Is it possible to automate logging into roblox?

Viewed 194

I have been playing roblox a lot lately, and I was wondering if there was a way to automate the login process since I play on different computers each time. I looked into Python's selenium, and derived the script:

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()

When I run it in VScode it works perfectly, but when I exported the python file and tried running it via interpreter, it gave many errors around version types. I installed selenium on the computer as well. My hypothesis is my local computer had some tools in the background that when I tried on other computers didn't. Is there something that I am missing when going to my other computer? I am using python3.8.

1 Answers

One thing you could is make a script, when executed runs by the python in your $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()

If you save this file in your terminal and run chmod +x <filename> to give it executable permissions, it will be a executable, which you can move from machines. Make sure to have all other selenium dependencies installed as well. When working with selenium, make sure your chrome driver is the same as your chrome browser, which you can read about on the chrome webdriver page.

Related