I am attempting to extract IP addresses from a webpage using the following code (snippet).
IPs = driver.find_elements_by_xpath("//span[contains(text(), '10.')]")
print(IPs)
The HTML element(s) look like this:
<span style="padding: 1px 4px;float:left;">10.20.20.20</span>
Inspect >> Copy Xpath returns:
//*[@id="T1700010887"]/tbody/tr[2]/td[1]/nobr/span
But all my code prints is what looks like generic selenium code:
[<selenium.webdriver.remote.webelement.WebElement (session="7885f3a61de714f2cb33
b23d03112ff2", element="0.5496921740104628-2")>, <selenium.webdriver.remote.webe
lement.WebElement (session="7885f3a61de714f2cb33b23d03112ff2", element="0.549692
1740104628-3")>, <selenium.webdriver.remote.webelement.WebElement (session="7885
f3a61de714f2cb33b23d03112ff2", element="0.5496921740104628-4")>]
How can I get it to print the actual IP of 10.20.20.20?