Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14301

Can't find element text using XPATH with Selenium

$
0
0

I keep getting the following exception because I cannot find an element. I have tried everything from CSS Selectors to XPATH:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="content"]/div[9]/div"}

Here are screenshots of the structure of the HTML:

HTML Code

It is the highlights div at the end.

I tried:

net_sales = driver.find_element(By.CSS_SELECTOR, "#content > div.tbGrossSalesWithTax.s4 > div")net_sales = driver.find_element(By.XPATH, '//*[@id="content"]/div[9]/div')

Is there a better way to highlight the element?


Viewing all articles
Browse latest Browse all 14301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>