Carol.Kar
Carol.Kar

Reputation: 5355

xpath - Get href attribute

I am trying to get all href links via xpath from the following page:

href page

I tried the following:

//div[@class='article-tile__images']/a[@class='article-tile__link js-article-tile__link acte-article-catalogName-lnk']

Any suggestions what I am doing wrong?

I appreciate your replies!

Upvotes: 2

Views: 633

Answers (1)

alecxe
alecxe

Reputation: 473863

Working with class attributes is much easier, readable and concise in CSS selectors:

a.article-tile__link

which matches 65 links when I issue $$('a.article-tile__link') in the Chrome console.

Upvotes: 3

Related Questions