from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
options = webdriver.FirefoxOptions()
options.set_preference("general.useragent.override", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0")
browser = webdriver.Firefox(options = options)
browser.get('https://www.youtube.com')
sleep(5)
browser.find_element(By.XPATH, r"/html/body/ytd-app/div[1]/div/ytd-masthead/div[4]/div[3]/div[2]/ytd-button-renderer/yt-button-shape/a/yt-touch-feedback-shape/div/div[2]" ).click()
browser.find_element(By.ID, "identifierId").send_keys("Ваш логин")
sleep(3)
browser.find_element(By.XPATH, r"/html/body/div[1]/div[1]/div[2]/c-wiz/div/div[3]/div/div[1]/div/div/button/span" ).click()