1

I am searching to do a program for fun but i have some problems with selenium and i need some help... This is the programm (i deleted the directory of webdriver because the folder's name contain the name of an other person)

from selenium import webdriver
import webbrowser
import time


def Pass_send_():
    driver=webdriver.Chrome()
    driver.get('chrome://flags/#password_export-enable')


    ricerca=driver.find_element_by_id("search")
    ricerca.send_keys('password export')
    scorritore=driver.find_element_by_class_name('experiment-select')
    scorritore.click()



Pass_send_()

And so the purpose it's easy, it should open a windows, type a text and click a button. everything works but the click doesn't and this is the error:

Traceback (most recent call last):
      File "C:\Python34\internet22.py", line 18, in <module>
Pass_send_()
  File "C:\Python34\internet22.py", line 14, in Pass_send_
scorritore.click()
  File "C:\Python34\lib\site- 
   packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Python34\lib\site- 
packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "C:\Python34\lib\site- 
packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Python34\lib\site- 
packages\selenium\webdriver\remote\errorhandler.py", line 242, in 
check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable

So i am not an expert but it says: element not intercatable? what does it mean and how can i fix it? i would really appreciate a reply...

2
  • You can add some time.sleep() after you send search keys. As the api may take time to load, so if you can have 5 sec delay, it will help you solve this problem. Commented Nov 25, 2018 at 17:44
  • well i tried but it didn't work, however i understood a new powerfull function so thank you very much <3 Commented Nov 26, 2018 at 18:26

1 Answer 1

0

To send a character sequence to the search box within the webpage chrome://flags/#password_export-enable you need to induce WebDriverWait and you can use the following solution:

  • Code Block:

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support import expected_conditions as EC
    
    options = Options()
    options.add_argument('start-maximized')
    options.add_argument('disable-infobars')
    options.add_argument('--disable-extensions')
    driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
    driver.get('chrome://flags/#password_export-enable')
    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input#search"))).send_keys("password export")
    
  • Browser Snapshot:

chrome_password_export

Sign up to request clarification or add additional context in comments.

3 Comments

So the error is gone but it doesn't works.... it opens the page and type the text but it doesn't click the button
i think because with your code the programm wait untill te button is clickable but for a reason, that i don't know, it isn't clickable so the program contiunue to wait...
@ScooterzGiovanni As per your question the step ...type a text... was clear that you want to send a character sequence to the search box, you never told us about which ...click a button.... As per your code trial, find_element_by_class_name('experiment-select') identifies 690 elements.

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.