I have HTML as shown (modified to make it brief)
ht=<a href="http:/www.myref.com/1235" title="This is link to my ref">This is my ref</a>
Now from here, I want to extract the "http:/www.myref.com/1235"
ht.get_text()
gives me only the text part This is my ref
.
Please help. Thanks in advance.
CodePudding user response:
If ht
is a webelement then,
ht.get_attribute('href')
should give you http:/www.myref.com/1235
Since you are getting TypeError: 'NoneType' object is not callable
This could mean either
ht
is not a web element.ht
is not rendered properly.
Put some delay before ht
and try again with ht.get_attribute('href')