#πŸ”’ Grab .ROBLOSECURITY cookie from python script

12 messages Β· Page 1 of 1 (latest)

indigo quest
#

Hey, im trying to make a script where it opens up roblox.com and gets the .ROBLOSECURITY cookie value. My code isnt working and I need help, this is where the cookie is in the photo. This is my code

import json
import subprocess
import time
import pychrome

def get_cookie_value(cookies):
    for cookie in cookies:
        if cookie['name'] == '.ROBLOSECURITY':
            return cookie['value']
    return None

chrome_process = subprocess.Popen([
    r'C:\Program Files\Google\Chrome\Application\chrome.exe',
    '--remote-debugging-port=9222',
    '--auto-open-devtools-for-tabs',
    'https://www.roblox.com/home'
])

time.sleep(5)

chrome = pychrome.Browser(url="http://127.0.0.1:9222")

tabs = chrome.list_tab()

tab = tabs[0]

def callback(message, data):
    if message['method'] == 'Page.loadEventFired':
        tab.Network.getCookies(callback=cookies_callback)

def cookies_callback(cookies):
    cookie_value = get_cookie_value(cookies['cookies'])
    if cookie_value:
        with open("COOKIE.txt", "w") as file:
            file.write(cookie_value)
    else:
        print("Failed to find .ROBLOSECURITY cookie")

tab.Page.enable()
tab.Page.navigate(url="https://www.roblox.com/home", callback=callback)

time.sleep(15)  

chrome_process.terminate()
strange heartBOT
#

@indigo quest

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

thin frigate
#

What are you trying to achieve here?

indigo quest
#

im trying to get the value of .ROBLOSECURITY with a script and make it paste it into a txt file

thin frigate
#

What is the purpose?

indigo quest
#

just want to learn new things and saw this on a youtube video so I wanted to create like a logger that logs cookies but i wanted to learn how to make one

#

not usin it for bad intent

thin frigate
#

πŸ€”

indigo quest
#

?

indigo quest
#

!close

strange heartBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.