crispychicken
crispychicken

Reputation: 2662

Convert Javascript/jQuery Query into XPath

I'm trying to convert the following jQuery into XPath:

$(".change_language_div span.k-dropdown:nth-of-type(2)")

This is what I have but it is not working:

$x("//div[@class='change_language_div']/span[@class='k-dropdown'][1]")

The first part: //div[@class='change_language_div'] is working but if I include the second part I get an empty array.

Upvotes: 0

Views: 117

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167696

Try $x("//div[@class='change_language_div']//span[2][@class='k-dropdown']").

Upvotes: 1

Related Questions