I have a div tag in which a tag is enclosed.
How can i get the value href?
For example, "https://www.tweeter.com/rkShukl" from <a> tag:
<a href="https://www.tweeter.com/rkShukl"></a>
It depends on the language bindings. In java it is getAttribute():
WebElement element = driver.findElement(By.id('id_of_the_link'));
element.getAttribute('href');
In Python it is get_attribute():
element = driver.find_element_by_id('id_of_the_link')
element.get_attribute('href')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With