S
S
subvillion2014-02-04 11:20:50
XPath
subvillion, 2014-02-04 11:20:50

How to get class name in span in Xpath?

There is an html like this:

<tr>
 <td class="aad-body aad-icon">
  <span class="aad-green-circle"></span>
 </td>
</tr>
<tr>
 <td class="aad-body aad-icon">
  <span class="aad-green-circle"></span>
 </td>
</tr>
<tr>
 <td class="aad-body aad-icon">
  <span class="aad-green-circle"></span>
 </td>
</tr>

How, using Xpath, to get the class names in the span tag, i.e. text aad-green-circle ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
avalak, 2014-02-04
@avalak

string(//span[1]/@class)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question