driver = webdriver.Chrome()
video = re.search('(https://youtube.com/watch.+?)\n', text)
driver.get(video.group(1))
time.sleep(1)
if prreg != 1:
driver.find_element_by_link_text("ВОЙТИ").click()
driver.find_element_by_css_selector('input[type="email"]').send_keys("logyotube")
driver.find_element_by_id("identifierNext").click()
time.sleep(3)
driver.find_element_by_name("password").send_keys("pasyotube")
driver.find_element_by_id("passwordNext").click()
time.sleep(2)
#скрол до комментариев
driver.execute_script("window.scrollTo(0, 3100)")
time.sleep(3)
driver.execute_script("window.scrollTo(0, 3100)")
time.sleep(4)
comment = "test"
#дождались комментария
box = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.CLASS_NAME, "ytd-comments-header-renderer")))
#сделали активным
driver.find_element_by_id('simplebox-placeholder').click()