Skip to content Skip to sidebar Skip to footer

How To Get Text, Using Selenium Python Xpath

I try to find and get element(text), using enter image description here elem = driver.find_element(By.XPATH,'//*[@id='t3_9kxrv6']/div/div/div[3]/span/h2') If I print it, I get: &l

Solution 1:

You want just .text

So, use this

elem = driver.find_element(By.XPATH,'//*[@id="t3_9kxrv6"]/div/div/div[3]/span/h2').text

Post a Comment for "How To Get Text, Using Selenium Python Xpath"