Monday, 15 April 2013

selenium - How to get link value inside href -


I have a div tag in which a tag is attached. How do I get the value href ?

For example, <"> and to tags:

  & lt; a href =" https: // www .tweeter com / rkShukl ">  

Depending on the language binding, it is getAttribute () in Java :

  WebElement element = driver.findElement (By.id ('id_of_the_link')) element .getAttribute ('href');  

In Python, this get_attribute () :

  element = driver.find_element_by_id (' Id_of_the_link ') element.get_attribute (' Href ')  

No comments:

Post a Comment