Here is the link of website from where I want to extract data,
I\'m trying to get all text of href
attribute under anchor tag.
Here is the sample html:
If you need all links values you should be using find_elements_....
functions, not find_element_...
functions as the latter one will return you first single match.
Recommended update for your code:
driver.get("http://www.carboline.com/products/")
for link in driver.find_elements_by_xpath("//ul[@id='productList']/descendant::*/a"):
if link.is_displayed():
print(link.text)
More information: