0

So I go to this website, Screen looks something like this: play btn I use Ctrl+Shift+C and select the play button, which is where I would click, the element looks like this:

<i class="material-icons flex" ng-show="!fullScreenOverlay.clicked &amp;&amp; !fullScreenOverlay.buffered &amp;&amp; !fullScreenOverlay.showTags &amp;&amp; recordingActivityLoaded" ng-click="playInit()" flex="" role="button" tabindex="0" aria-hidden="false" style="">play_circle_outline</i>

I copy it's xpath and I do this with webdriver:

btn = wd.find_element_by_xpath('/html/body/div[8]/i[1]')
btn.click()

But I receive this error:

ElementNotInteractableException: Message: element not interactable
  (Session info: headless chrome=91.0.4472.101)

I can click on it, why can't the webdriver?

1 Answer 1

1

In This Case The Element is most likely not findable or clickable. Please Check How You Are Getting the element and if it is clickable in the browser or not. For This Case The COde Should Be

import sys
import time
sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
wd = webdriver.Chrome('chromedriver',options=chrome_options)
wd.get("https://recordings.aakashdigital.com/attend/4m3e2r1i@t!MTA2NzE1M180MDY3MTIwMz9uYW1lPXNoaXZlbiBndXB0YQ")
time.sleep(4)
btn = wd.find_element_by_xpath('/html/body/div[8]/i[1]')   
btn.click()
wd.save_screenshot('sc.png')
wd.quit()
Sign up to request clarification or add additional context in comments.

17 Comments

If it is not clickable, how can I click it? Is there like an activity tab, where I can see which element I clicked or something along those lines ?
This Must Most Likely then mean that the element in not findable, please check by adding this piece of code ``` if btn.isDisplayed(): print('hello') ``` So If Hello Is Printed in the console then the element is finadable. or else i dont know what the problem is.
Just checked, btn.is_displayed() returns False so hello does not get printed to the console
Hi, sorry for replying so late. please recheck the xpath and cross check it with finding the xpath with the help of the answer at stackoverflow.com/a/13884744/14747127
for me in google colab the following code is working. I will Update The Answer
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.