Unable To Login In Binance And Bitget Using Cookies

symonkings

Regular Member
Joined
Mar 7, 2024
Messages
494
Reaction score
152
I used the Cookie Export extension to download JSON cookies for my Binance and Bitget accounts, but with python script it was unable to log in. I also added inline cookies from the inspection tool but still failer.
 
I used the Cookie Export extension to download JSON cookies for my Binance and Bitget accounts, but with python script it was unable to log in. I also added inline cookies from the inspection tool but still failer.
You don't need cookies to log into those accounts.
 
Save and load them with pickle ... why are you using external extensions when you are using python is the first question ?

P.S. Example below

Code:
    def load_cookies(self, driver, buttons):
        driver.get("https://x.com")
        time.sleep(0.5)
        buttons.click_element("accept_cookies", "accept cookies")
        buttons.click_element("migration_btt", "migration button")
        
        with open(os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl"), 'rb') as cookies_file:
            cookies = pickle.load(cookies_file)

        attempt = 0

        while attempt < 3:
            time.sleep(0.5)
            for cookie in cookies:
                driver.add_cookie(cookie)
            time.sleep(2)
            driver.refresh()
            time.sleep(2)
            
            if self.check_cookies_loaded_succesfully(driver, buttons):
                return True
            else:
                attempt += 1
                time.sleep(2)

        return False

    def save_cookies(self, driver):
        cookie_path = os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl")

        os.makedirs(os.path.dirname(cookie_path), exist_ok=True)

        cookies = driver.get_cookies()

        with open(cookie_path, "wb") as cookies_file:
            pickle.dump(cookies, cookies_file)
 
Save and load them with pickle ... why are you using external extensions when you are using python is the first question ?

P.S. Example below

Code:
    def load_cookies(self, driver, buttons):
        driver.get("https://x.com")
        time.sleep(0.5)
        buttons.click_element("accept_cookies", "accept cookies")
        buttons.click_element("migration_btt", "migration button")
       
        with open(os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl"), 'rb') as cookies_file:
            cookies = pickle.load(cookies_file)

        attempt = 0

        while attempt < 3:
            time.sleep(0.5)
            for cookie in cookies:
                driver.add_cookie(cookie)
            time.sleep(2)
            driver.refresh()
            time.sleep(2)
           
            if self.check_cookies_loaded_succesfully(driver, buttons):
                return True
            else:
                attempt += 1
                time.sleep(2)

        return False

    def save_cookies(self, driver):
        cookie_path = os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl")

        os.makedirs(os.path.dirname(cookie_path), exist_ok=True)

        cookies = driver.get_cookies()

        with open(cookie_path, "wb") as cookies_file:
            pickle.dump(cookies, cookies_file)
Ok I will try
 
Save and load them with pickle ... why are you using external extensions when you are using python is the first question ?

P.S. Example below

Code:
    def load_cookies(self, driver, buttons):
        driver.get("https://x.com")
        time.sleep(0.5)
        buttons.click_element("accept_cookies", "accept cookies")
        buttons.click_element("migration_btt", "migration button")
       
        with open(os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl"), 'rb') as cookies_file:
            cookies = pickle.load(cookies_file)

        attempt = 0

        while attempt < 3:
            time.sleep(0.5)
            for cookie in cookies:
                driver.add_cookie(cookie)
            time.sleep(2)
            driver.refresh()
            time.sleep(2)
           
            if self.check_cookies_loaded_succesfully(driver, buttons):
                return True
            else:
                attempt += 1
                time.sleep(2)

        return False

    def save_cookies(self, driver):
        cookie_path = os.path.join(self.paths.twitter_cookies, f"{self.account}.pkl")

        os.makedirs(os.path.dirname(cookie_path), exist_ok=True)

        cookies = driver.get_cookies()

        with open(cookie_path, "wb") as cookies_file:
            pickle.dump(cookies, cookies_file)
Ok so it works in Binance very easily but not in bitget I try so many times but still failer with Bitget
 
Ok so it works in Binance very easily but not in bitget I try so many times but still failer with Bitget
Check the content of the cookies maybe they expire on log out or in a short period of time
 
I used the Cookie Export extension to download JSON cookies for my Binance and Bitget accounts, but with python script it was unable to log in. I also added inline cookies from the inspection tool but still failer.
Hello so in Binance it works very fine but in bitget it's not I don't know why can someone please give me alternative solution.
 
Back
Top