I am facing a challenge in fetching an element from the netlify dashboard. The code I have currently grabs the base element that the web developers have set, indicating that it gets updated with javascript. However, I am having trouble accessing this updated information. Even though my dashboard displays 1 MB, my output always shows 0 KB, suggesting that I am only able to retrieve the base text. My current code:
driver = webdriver.Chrome()
driver.get("https://app.netlify.com/teams/jimbob0119/overview")
element = driver.find_element_by_name("github")
element.click()
driver.implicitly_wait(10) # seconds
login = driver.find_element_by_name("login")
login.send_keys(email)
password = driver.find_element_by_name("password")
password.send_keys(passwordstr)
loginbtn = driver.find_element_by_name("commit")
loginbtn.click()
driver.implicitly_wait(10) # seconds
getbandwidth = driver.find_element_by_xpath("//dd[@class='tw-text-xl tw-mt-4px tw-leading-none']")
print(getbandwidth.text)
The HTML structure:
<dd class="tw-text-xl tw-mt-4px tw-leading-none"> 1 MB
<span class="tw-text-gray-darker dark:tw-text-gray-light tw-text-base">
<span class="tw-sr-only">
out of
</span> /100 GB
</span>
<span class="tw-absolute tw-mt-2px tw-w-full">
</span>
</dd>
Actual output received:
0 KB
out of
/100 GB