简体   繁体   中英

How do you get text between tags using python and webdriver?

I have <a href="MENU.asp?navid=1">Property</a> and need to get the text "Property". I found the href element but when I tried get_attribute("value") on it, it returns "None"

It's not the value of the tag, its the innerHTML of the tag. So try to fetch that:

get_attribute("innerHTML")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM