Answer the question
In order to leave comments, you need to log in
Selenium, Python | get_attribute('text') method returns None?
Hi all. Faced the following problem. The get_attribute('text') method, which should return the element's text value, returns None. Here is the code:
def test_buy():
self.driver.get('https://receive-sms.com/')
elem = WebDriverWait(self.driver, 10).until(
EC.visibility_of_element_located((By.XPATH, '//*[@id="messages-table"]/tbody/tr[1]/td[4]')))
return elem.get_attribute('text')
<td data-title="[Date]" class="td-date" title="2020-11-01 06:26:18">[2020-11-01 06:26:18]</td>
<td data-title="[From]" class="td-from">[17192126163]</td>
<a title="Click to see SMS received on 12048193380" href="/12048193380" style="color:white;">12048193380</a>
<td data-title="[Message]" class="td-message">[101955 is your verification code for your Sony account.]</td>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question