How do I get the TEXT of a hyperlink with selenium and python?
This is the html in question:
<a ng-href="/example/example2/" href="/example/example2/">NEEDED TEXT</a>
I already have the element of the 'a' tag and I am able to successfuly get the link by doing element.get_attribute("href").
But when I try to do element.text i am not able to get "NEEDED TEXT". What is the reason for this?
element.text
? – Alexey R. Dec 26 '18 at 10:12element.text
. I ended up getting it to work with bothelement.get_attribute('innerHTML')
andelement.get_attribute('text')
– E. Jin Jan 3 '19 at 7:01