0

I'm trying to click in the area 5 pixels below a class name on a web page.

This is the code :

homeLink = driver.find_element_by_class_name('*****')
action = webdriver.common.action_chains.ActionChains(driver)
action.move_to_element_with_offset(homeLink, 0, 5) 
action.click()
action.perform()

The error: "Message: no such element: Unable to locate element: {"method":"class name","selector":"*****"}"

The html:

<div class="*****">Internal Tags</div>

4
  • And what is your question? Commented Oct 11, 2018 at 18:01
  • @Andersson How to fix the error Commented Oct 11, 2018 at 18:03
  • Try to implement Wait or check if element located inside an iframe Commented Oct 11, 2018 at 18:04
  • What is *****? Normally, in HTML, the class attribute is a space-separated list of classes, and the method find_element_by_class_name() takes one of those classes. Commented Oct 11, 2018 at 18:59

1 Answer 1

1

You may refer this,

homeLink = driver.find_element_by_xpath("//div[@class='*****' and contains(text(),'Internal Tags')]")
action=ActionChains(driver)
action.move_to_element(homeLink).click().perform() 
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.