Oct-17-2017, 06:31 PM
Hello, I'm trying to do a bot that sign in youtube, pick a random video and click in the (...) button, I have done the SIGN IN and the video pick but I couldn't be able to click the button (...) inside the video. I have tried by ID, class name, xpath and css locator. I'm using python selenium PyChrome for this, thanks for your answers :)
Using this on python:
link = "youtube.com"
from pyChrome import PyChrome
browser = PyChrome()
browser.open(link)
#here goes the code for the SIGN IN and the video pick up, let's imagine that we have already picked one video
locator = ""
element = browser.findElement(id,classname,xpath,css = locator) #have tried those attributes
browser.clickElement(element)
By clicking in the inspect option of the button (...):
<button is="paper-icon-button-light" id="button" class="dropdown-trigger style-scope ytd-menu-renderer" aria-label="More actions">
<yt-icon class="style-scope ytd-menu-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon">
<circle cx="5" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="12" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="19" cy="12" r="2" class="style-scope yt-icon"></circle>
</g></svg>
</yt-icon>
<paper-ripple class="style-scope paper-icon-button-light circle">
<div id="background" class="style-scope paper-ripple" style="opacity: 0;"></div>
<div id="waves" class="style-scope paper-ripple"></div>
</paper-ripple></button>
The error message it's always: Couldn't find element or Couldn't click element by id,classname,css or Xpath
Using this on python:
link = "youtube.com"
from pyChrome import PyChrome
browser = PyChrome()
browser.open(link)
#here goes the code for the SIGN IN and the video pick up, let's imagine that we have already picked one video
locator = ""
element = browser.findElement(id,classname,xpath,css = locator) #have tried those attributes
browser.clickElement(element)
By clicking in the inspect option of the button (...):
<button is="paper-icon-button-light" id="button" class="dropdown-trigger style-scope ytd-menu-renderer" aria-label="More actions">
<yt-icon class="style-scope ytd-menu-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon">
<circle cx="5" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="12" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="19" cy="12" r="2" class="style-scope yt-icon"></circle>
</g></svg>
</yt-icon>
<paper-ripple class="style-scope paper-icon-button-light circle">
<div id="background" class="style-scope paper-ripple" style="opacity: 0;"></div>
<div id="waves" class="style-scope paper-ripple"></div>
</paper-ripple></button>
The error message it's always: Couldn't find element or Couldn't click element by id,classname,css or Xpath