I am having issues getting an element from the netlify dashboard. The code I have currently selected the element and shows the base element the web developers set, so obviously, they update it with javascript however how do I get this. On my dashboard it states 1 MB but my output is 0 KB each time so it seems I am only getting the base text My 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:
<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>
my output:
0 KB
out of
/100 GB
$3is specific to the Chrome devtools and is not in the HTML so it cannot be fetched. If you tell us which value you're trying to get, we can help with that.implicitly_wait()doesn't actually wait. What it does do is set a timeout for that instance of the driver. So, you only need to call it once, unless you plan to change the wait value from say 10s to 30s or whatever. The rest of the calls can be removed.