我正在使用Simple DOM Parser,我正在尝试从动态表中获取一些信息,如下所示:
<table />
<tr>
<td class="histogram-msg top-row">5 star</td>
<td class="top-row bar-cell"><span class="bar bar5" style="width:150px"> </span> <span>55</span></td>
</tr>
<tr>
<td class="middle-row histogram-msg">4 star</td>
<td class="middle-row bar-cell"><span class="bar bar4" style="width:65px"> </span> <span>24</span></td>
</tr>
<tr>
<td class="middle-row histogram-msg">3 star</td>
<td class="middle-row bar-cell"><span class="bar bar3" style="width:38px"> </span> <span>14</span></td>
</tr>
<tr>
<td class="middle-row histogram-msg">2 star</td>
<td class="middle-row bar-cell"><span class="bar bar2" style="width:19px"> </span> <span>7</span></td>
</tr>
<tr>
<td class="bottom-row histogram-msg">1 star</td>
<td class="bottom-row bar-cell"><span class="bar bar1" style="width:35px"> </span> <span>13</span></td>
</tr>
</table>
我正在尝试获取表中的值,即:5 星 | 55, 4 星 | 24 等
我得到这个信息$ret = $html->find('.user-ratings');
,当我尝试打印跨度标签时,它只会给我一堆空白。
如何从上表中获取评级类型和值?