selenium find element by xpath and child tag not working

  Kiến thức lập trình

For the DOM

With my Python selenium code

  refresh_button = driver.find_element(By.XPATH, '//div[@class="refreshIcon"]/a')

I’m getting

    selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@class="refreshIcon"]/a"}
  (Session info: chrome=126.0.6478.126); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

Why?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT