I have the following HTML code:
<div class="t2-selector">
<div>
<div class="inactive">USA</div>
<div class="inactive">Google</div>
<div class="inactive">Microsoft</div>
<div class="inactive">Apple</div>
</div>
<div>
<div class="">Europe</div>
<div class="selected">BT</div>
</div>
<div>
<div class="">Indices</div>
<div>Vodafone</div>
<div>Renault</div>
</div>
<div>
<div class="">Currencies</div>
<div>EUR/USD</div>
<div>GBP/USD</div>
<div>USD/JPY</div>
<div>USD/CHF</div>
<div>AUD/USD</div>
<div>USD/CAD</div>
</div>
I can select a group by Xpath xpath = "//div[contains(text(),'Currencies')]"
What I need is to select a child in Currencies list by it's number.
I need something like CSS div:nth-child(2) but I can't use CSS here since CSS doesn't really support selecting an element by text.
So is there nth-child analog for Xpath?
csstag for reference to thenth-childselector then i assume?XpathorCSSexpression to select the desired element and click on it, maybe extract it's attribute, never changing it. And as about theCSStag I used - you are right, it is because I was looking fornth-childanalog.