M
M
MyName-name2020-02-18 21:08:18
YouTube
MyName-name, 2020-02-18 21:08:18

Why is Selenium not responding in any way?

Hello!
The other day I started trying the Selenium library and everything was very good, but then it’s not clear why Selenium stopped clicking, I tried this code on another computer and everything works, but on my main one it doesn’t (
Well, Selenium just doesn’t makes a click, that is, does not put a like on youtube, although before that everything worked and I didn’t change anything, and the program doesn’t even give any errors and pretends that everything is done
I already set the time after the click and what I didn’t do (
And the most important thing is that everything works on other sites, but not on YouTube! It's
just not clear how everything works on another computer, but on my main one it doesn't...
Help please, I can't find the answer for 4 days already!!!I
use Python 3.5 and Selenium 3.0.0

from selenium import webdriver
import time

url = 'url_video'
FILE_NAME_PROFILE = "C:/Users/xxx/AppData/Local/Google/Chrome/User Data"
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=" + FILE_NAME_PROFILE)
driver = webdriver.Chrome(executable_path="C:/Users/xxx/Downloads/chromedriver_win32 (1)/chromedriver.exe", chrome_options=options)
driver.get(url)
time.sleep(10)
like = driver.find_element_by_xpath('//yt-icon[@class="style-scope ytd-toggle-button-renderer"]')
like.click()
driver.quit()

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marayg, 2020-02-19
@marayg

If it works on other computers, but not on yours, then the problem may be in the versions of the web driver and browser.

S
SvinkaBacilka, 2020-02-21
@SvinkaBacilka

Try to upgrade Selenium with the command:
pip install --upgrade selenium
Or run the javascript:

driver.execute_script("document.getElementsByClassName('style-scope ytd-toggle-button-renderer')[0].click()")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question