Python & Selenium: How to find and click on YouTube's Like button

0 votes
Do you people know how to find and click on Youtube's Like button in Python using selenium? Issues is since it doesn't have a real Id, etc...
Mar 26, 2018 in Selenium by nitinrawat895
• 10,730 points
728 views

2 answers to this question.

0 votes
Use the CSS Selector button to like:
#watch8-sentiment-actions > span > span:nth-child(1) > button
answered Mar 26, 2018 by nsv999
• 5,110 points
0 votes

Hello Nitin, as the Like button on Youtube doesn't have a real ID, we can still use relative/absolute xpath to locate it. You can get the xpath with the help of ChroPath extension. For eg: Xpath for Like button on a youtube video is:

//div[@id='info']//ytd-toggle-button-renderer[1]//a[1]//yt-icon-button[1]//button[1]//yt-icon[1]
answered Aug 23 by Abha
• 27,180 points

Related Questions In Selenium

0 votes
3 answers
+1 vote
2 answers

How to click button selenium python?

Have you tried using implicit_wait method before getting ...READ MORE

answered May 27 in Selenium by Abha
• 27,180 points
2,077 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 13,960 points
242 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,012 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,155 views
0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 56,940 points
8,894 views
0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12 in Selenium by anonymous
11,755 views