1
I need to be able to comment on Youtube, but XPATH does not work, even with the right parameters, I tried with ID and ELEMENT but I was not successful.
from selenium import webdriver
import keyboard
import time
#--------------pra comentar faça login no gmail inserindo os paramentros login_Gmail,password_Gmail.--------------#
driver = webdriver.Chrome(r"C:\Users\FAMILIA\Downloads\aaa\chromedriver.exe")
x = driver.get('https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin')
time.sleep(2)
login_Gmail = driver.find_element_by_xpath('//*[@id="identifierId"]').send_keys('SEU EMAIL GMAIL')
print('e-mail ok')
time.sleep(2)
keyboard.press('Enter')
time.sleep(2)
password_Gmail = driver.find_element_by_xpath('//*[@id="password"]/div[1]/div/div[1]/input').send_keys('SUA SENHA GMAIL')
print('senha ok')
time.sleep(2)
keyboard.press('Enter')
print('login feito')
time.sleep(1)
x = driver.get('https://www.youtube.com/watch?v=9nV9GNjXFDo&list=RD9nV9GNjXFDo&start_radio=1')
time.sleep(3)
print('youtube video')
comment_New = driver.find_element_by_xpath('//*[@id="contenteditable-textarea"]').send_keys('TEXTO A SER COEMNTADO') ###ESTA PARTE QUE ESTOUC COM PROBLEMAS###
keyboard.press('Enter')