I know variants of this question have been asked a number of times but I've not been able to crack it and get what I want. I have a website which has a few tables in it. The table
Solution 1:
Try something like:
href_elements = doc.xpath('//center//table//a[contains(@href,".txt")]["Text"]/@href')
for href in href_elements:
print(href)
Post a Comment for "Extract Href Values Containing Keyword Using Xpath In Python"