I have the following HTML in a web page where I need to retrieve number of jobs in a table:
<span class="k-pager-info k-label">1 - 10 of 16 items</span>
I can find the element succesfully in various ways, but when I try to retrieve the number of rows, the 16 in "1 - 10 of 16 items", it returns NULL.
I find the element as below which gives the element session and GUID:
job_items = driver.find_element(By.CSS_SELECTOR, 'span.k-pager-info.k-label')
print('Jobs: ', job_items)
Output: Jobs: <selenium.webdriver.remote.webelement.WebElement (session="f528f37ec897b8c5006b3b5040a99c12", element="758533ea-800f-4895-ba66-e8247e882edb")>
Getting the same element using Xpath and now requesting the text value:
job_items = driver.find_element(By.XPATH, '/html/body/div[1]/div/div[4]/div/div[2]/div[1]/div/div/span[2]').text
print('Jobs1: ', job_items)
Output: Jobs1: No items to display
I tried XXX.get_attribute("innerHTML") as well, also returns empty list / NULL
What am I missing please?