I have recently been trying to run a command through python in a web browser, as if using chrome developer tools.
This is easy to do from chrome, but how would I do it from python? I have no idea how I would go about replicating this from a python script. The browser command I am wanting to run is specific to the website I am working with, which is why I need to use the command line.
How can I repsslicate running a command in the browser command line, in python 3? Sorry if this is a stupid question. Thanks!
EDIT:
I ended up using selenium, but ran into some problems. The site I am traveling to( roblox.com ), says that I am Unauthorized in the browser console.
I am pretty sure that I implemented the authentication cookies correctly though, as I am logged in. For some reason, some of my data just isn't loading, such as my currency count.
This probably isn't the place to ask a question like this, since the members of this forum know nothing of roblox, but maybe it's a simple problem in my code.
# my code
from selenium import webdriver
import time
driver = webdriver.Chrome('C:\\Users\KDJ\Documents\GameJoiner\chromedriver.exe')
options = webdriver.ChromeOptions()
driver.execute_cdp_cmd('Network.setUserAgentOverride', {"userAgent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.53 Safari/537.36'})
driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
URL = 'https://www.roblox.com/games'
driver.get(URL)
driver.add_cookie({'name' : '.ROBLOSECURITY', 'value' : Cookie})
driver.get(URL)
As a side note, you might not see me defining the Cookie variable. This is because I removed it, since this cookie allows others to log into my account.

