There is only one line to use xpath in selenium

I want all the data on the page, but there is only one item taken down with xpath! Do I have a misunderstanding about xpath?

clipboard.png
girlname=driver.find_element_by_xpath("//div[@id="zoom"]/p")
print(type(girlname))
girlname=girlname.text
print(type(girlname))
print(girlname)

clipboard.png

this is the only one, which really puzzles me. I hope my seniors" advice, thank you

Nov.11,2021

girlname should be a collection that allows breakpoints to check whether the specific content is multiple, which is only valid for the first element when girlname.text directly. Here are the test cases for lxml


    <title>Title</title>
</head>
<body>
<div>
    

1

2

3

4

5

</div> </body> </html>""" html = etree.HTML(html) a = html.xpath("//div/p") for i in a: print(i.text)
Menu