【发布时间】:2013-07-06 05:07:22
【问题描述】:
我正在尝试使用空类或未禁用的类获取位于标签元素中的数据。不幸的是,我尝试过的选择器都没有,比如 jQuery ":Not" 选择器。
到目前为止我的代码是:
$element = $html->find('div .titleHeader label', 0);
理想情况下会提取: 110 分:
<label for="attribute76">
<input id="attribute76" class="jshide" type="radio" value="76" name="super_attribute[144]">
110
</label>
而不是 105 个:
<label class="disabled" for="attribute75">
<span class="crossedStock"> </span>
<input id="attribute75" class="jshide" type="radio" disabled="disabled" value="75" name="super_attribute[144]">
105
</label>
【问题讨论】:
-
不幸的是,没有。
label[class='disabled']确实给了我回报,但例如:label[class!='disabled']也不起作用。 -
那里没有 div,所以显然没有这个工作的机会。
标签: php parsing css-selectors html-parsing simple-html-dom