I am trying to get the elements displayed as N06D-X N07X R01A-C01 S01G-X01 in the following image:
Now, I got something like the WebDriver in this way:
who = driver.find_element_by_tag_name("span").find_elements_by_tag_name("p")
and get an output like this:
[<selenium.webdriver.remote.webelement.WebElement (session="1c044455cf883fdedf6845bcd456bfab", element="0.23338884730774767-2")>]
I am working on Mac Catalina and when I type: who.text it returns an empty list for some reason. I got quite similar troubles with Bs but I solved them with .string
rather than .text
. Here .string
does not work on WebDriver elements.
The question is: how can I get the items N06D and so on with selenium?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…