0

I have looked at the Selenium documentation and can not find an example of clicking on an element. I inspected an element named attatchments.

Everytime I attempt to click the element Python gives me an error usually one of these:

{'using': by, 'value': value})['value'] File "C:\Python27\lib\site-packages\selenium-2.24.0-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 155, in execute self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium-2.24.0-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 147, in check_response raise exception_class(message, screen, stacktrace) NoSuchElementException: Message: u'Unable to locate element: {"method":"name","selector":"add individuals"}'

Here is the code I am trying:

driver.find_element_by_name("attatchments")
elem.click()

1 Answer 1

0

If you know element id then you can get it as

element = driver.find_element(by=By.ID, value="element_id")

Or

element = driver.find_element_by_id("element_id")

and then use element.click()

You can go through this link to know the methods in Webdriver class: http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html

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

1 Comment

elem = driver.find_element("attatchments") elem.click() WHen I inspect I see attatchments for input. shows exception class Unsupported locator startegy attatchments? Any help is appreciated do i need a wait? if so how do i write a quick wait or is it another problem all together.

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.