bnp2
bnp2

Reputation: 1

Xpath combine two @class elements

I want to find the following element on a web site: //a[@class="a-link-normal"]/@href inside this element: //div[@class="s-result-list s-search-results sg-row"]. I tried this one: //*[contains(@class='s-result-list s-search-results sg-row') and contains(@class='a-link-normal')]")) but it doesn't work, xpath helper shows "invalid xpath expression". Probably the solution is quite simple, but i can't make it work.

Thanks in advance

Upvotes: 0

Views: 1129

Answers (1)

E.Wiest
E.Wiest

Reputation: 5905

So, Amazon. You're looking for this (you didn't use the correct div) :

//div[@class="s-main-slot s-result-list s-search-results sg-row"]//a[@class="a-link-normal"]

Upvotes: 1

Related Questions