[Python] Issue with AttributeError: 'WebDriver' object has no attribute 'manage'

Discussão em 'Python' iniciado por Stack, Junho 11, 2025.

  1. Stack

    Stack Membro Participativo

    My code:

    commentr = driver.find_element_by_id("simplebox-placeholder")
    commentr.click()

    driver.execute_script("document.getElementById('simplebox-
    placeholder').value = 'your comment text here';")
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    commentr.send_keys("HELO")


    My error:


    Traceback (most recent call last): File "C:\Users\weqwwg\Desktop\python\Game.py", line 77, in driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); AttributeError: 'WebDriver' object has no attribute 'manage'
    ​

    I'm trying to send a key to the comment box on youtube. I removed some code, I am currently running this code.

    commentr = driver.find_element_by_id("simplebox-placeholder")
    commentr.click()
    driver.implicitly_wait(10)
    commentr.send_keys("HELO")


    This is the error I'm getting:

    Traceback (most recent call last):
    File "C:\Users\Brandsdo\Desktop\python\Game.py", line 76, in <module>
    commentr.send_keys("HELO")
    File "C:\Users\Braasdasndo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys
    'value': keys_to_typing(value)})
    File "C:\Users\Brsadasdando\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
    File "C:\Users\Braasdasndo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
    File "C:\Users\Braasdando\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
    (Session info: chrome=73.0.3683.103)
    (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17763 x86_64)


    UPDATED PART OF CODE

    driver.find_element_by_id("simplebox-placeholder").click()

    commentr = WebDriverWait(driver,10).until(EC.element_to_be_clickable( (By.ID, 'contenteditable-textarea') ))

    commentr.click().send_keys("HELO")
    driver.find_element_by_id("submit-button").click()


    THIS IS THE ERROR


    Traceback (most recent call last): File "C:\Users\Desktop\python\Game.py", line 74, in commentr.click().send_keys("HELO") AttributeError: 'NoneType' object has no attribute 'send_keys'
    ​

    Continue reading...

Compartilhe esta Página