# How can I get the href of elements found by partial link text using Selenium?

SeleniumAutomation TestingTesting Tools

#### Selenium Online Training

46 Lectures 5.5 hours

#### Selenium 4 - New Features

22 Lectures 7 hours

#### New Selenium IDE

118 Lectures 17 hours

We can get the href of elements found by partial link text with Selenium webdriver. First of all we need to identify the links with help of the find_elements_by_partial_link_text() method.

Next to get hold of href of the links we have to use the get_attribute() method and then pass href as a parameter to the method.

Let us identify the href attribute of links identified with partial link text Policy in the below page.

## Example

from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\chromedriver.exe")
driver.implicitly_wait(0.5)
driver.close()