0

I am trying to automate login to a web cite with selenium and python.

driver = webdriver.Firefox ()
driver.get (page)  

this line

WebDriverWait (driver, 10).until( EC.presence_of_element_located (By.CSS_SELECTOR("#top-login-uname")))

produces the following error

WebDriverWait (driver, 10).until( EC.presence_of_element_located (By.CSS_SELECTOR("#top-login-uname")))
TypeError: 'str' object is not callable

the argument to CSS_SELECTOR seems to be correct...
I able to find the line with Firefox search line.

1 Answer 1

1

In Python you should use

EC.presence_of_element_located((By.CSS_SELECTOR, "#top-login-uname")))

Note that EC.presence_of_element_located() should accept tuple of by and value

TypeError: 'str' object is not callable is generated because By.CSS_SELECTOR stands for a simple string 'css selector'

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

Comments

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.