0

I am running this code in Google Colab:

button = driver.find_element_by_xpath("//button[@type='submit']")
#button.click()
#driver.implicitly_wait(10)
try:
    # Wait as long as required, or maximum of number sec for condition
    WebDriverWait(driver,10).until(cond.element_to_be_clickable(By.XPATH,"//button[@type='submit']")).click()

    output = driver.find_elements_by_id('textfield2')
    print(output[0].get_property('value'))

except (TimeoutException) as py_ex:
    print(py_ex)
finally:
    driver.quit()

and it gives error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-92-6eec021e5bb4> in <module>()
     31 try:
     32     # Wait as long as required, or maximum of number sec for condition
---> 33     WebDriverWait(driver,10).until(cond.element_to_be_clickable(By.XPATH,"//button[@type='submit']")).click()
     34 
     35     output = driver.find_elements_by_id('textfield2')

TypeError: __init__() takes 2 positional arguments but 3 were given

I have seen this error reported by others (user:4483819) but no answer

Len Yabloko
  • 35
  • 1
  • 8
  • @Heinz reported the same error here https://stackoverflow.com/questions/56380889/wait-for-element-to-be-clickable-using-python-and-selenium – Len Yabloko Jul 13 '21 at 00:41

0 Answers0