Issue
i have Code like this:
<mat-label _ngcontent-vrc-c49="" class="filingCount ng-star-inserted">2 RRR</mat-label>
and i want value : 2 RRR
i tried with:
element = driver.find_element_by_xpath('//*[@id="maincontentid"]/app-dashboard/app-itr-status/div[4]/mat-label')
print(element.text)
but it's give the zero
Solution
Possibly you have to add wait until the element is visible. Like this:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 20)
element = wait.until(EC.visibility_of_element_located((By.XPATH, '//*[@id="maincontentid"]/app-dashboard/app-itr-status/div[4]/mat-label')))
print(element.text)
If still not working validate your locator correctness.
Answered By - Prophet
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.