Answer the question
In order to leave comments, you need to log in
Why is Cookie from Telegram not saved?
Hello! I need to automate the login to Telegram using Selenium, but when I try to save Cookies through the pickle library, I get nothing (and this code works fine with VK), what could be the problem? The code:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import pickle
from threading import Thread
import keyboard
import os
options = Options()
driver = webdriver.Firefox(
executable_path="C:\\Users\\я\\Desktop\\Bot\\geckodriver.exe",
options=options
)
driver.get("https://web.telegram.org/k/")
def checker():
while True:
if keyboard.is_pressed("f1"):
pickle.dump(driver.get_cookies(), open(f"after.pkl", "wb"))
A = Thread(target=checker)
A.start()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question