【发布时间】:2016-05-14 03:54:47
【问题描述】:
我有一个解析 html 页面的脚本。一节解析各种 tr 元素。假设我们有一个这样的 tr 结构:
<tr class="a test" style="display: none;">
<td class="numeric"></td>
<td class="date">1/1/16</td>
<td class="numeric">$2.65</td>
.... etc....
</tr>
<tr class="another tr">
...... etc......
当前运行良好的代码是这样的:
$the_row_I_want = $parseSectionofCodeImlookingat->find("tr:eq($rowIwant)");
$entire_tr_in_html = $the_row_I_want->__toString();
它的作用是返回整个 tr 的 html,我可以从中解析出类名和样式部分。但是我一直在尝试找出如何使用 phpQuery 语法为我解析类名和样式部分。有没有办法使用 phpQuery(以及如何)来做到这一点?
【问题讨论】:
标签: phpquery