How do I detect text inside of this, this is HTML & this is XPath. I tried
HTML
<span class=”messageText”>Hello.</span>
XPath
//*[@id=”liveAgentChatLogText”]/span[22]/span[2]
I tried with this but it didn’t work, it said no such element found.
driver.find_element(By.XPATH, ‘//*[@id=”liveAgentChatLogText”]//*[contains(string(.), “Hello”)]’)
Source: Read More