How To Pull Out Text From A Div Class Using Selenium Headless
I'm trying to pull out the '0%' from the following div tag:
0%
my current code is: from selenium import webdriver from seSolution 1:
As per the HTML you have shared to extract the text 0% you need to use the method get_attribute("innerHTML")
and you can use either of the following solutions:
Solution 2:
First of all, not "elements", it is "element". and, second point is, you didn't get ttext. you just called element.
so, here is the code:
element_text = driver.find_element_by_xpath("//div[@class='sem-report-header-td-diff']").text
Post a Comment for "How To Pull Out Text From A Div Class Using Selenium Headless"