close

How to find an element by href value using selenium python?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to find an element by href value using selenium python in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to find an element by href value using selenium python?

  1. How to find an element by href value using selenium python?

    You can use find_element_by_xpath functionality.
    driver.find_element_by_xpath('//a[@href="'+url+'"]')

  2. find an element by href value using selenium python

    You can use find_element_by_xpath functionality.
    driver.find_element_by_xpath('//a[@href="'+url+'"]')

Method 1

You can use find_element_by_xpath functionality.

driver.find_element_by_xpath('//a[@href="'+url+'"]')

Method 2

You can try this:

driver.find_element_by_xpath('//a[contains(@href,"href")]')

Conclusion

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read