I have an HTML tag that looks like this
<tr class="js-row DC is-odd" data-nationality="Indian" data-team-id="3">
<td class="top-players__freeze js-pos top-players__pos DC">2</td>
<td class="top-players__freeze top-players__player">
<div class="top-players__image">
<img class="js-headshot" src="//static.iplt20.com/players/210/Photo-Missing.png"
I'm trying to extract the data-nationality value using XPath, however I'm not quite sure how to do this.
I have tried something like this, after selecting the tr element:
driver.find_elements_by_xpath("//tr[contains(@class,'js-row DC is-odd')]/@data-nationality")
However this didn't work. Can someone help me out with this?