-2

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:

<selenium.webdriver.remote.webelement.WebElement (session="2c3430395624712686d8cbfe1824c18e", element="0.06192509533309787-1")>

and I want: "The problems of a dutchman in China."

1 Answers1

2

You want just .text

So, use this

elem = driver.find_element(By.XPATH,'//*[@id="t3_9kxrv6"]/div/div/div[3]/span/h2').text
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352