我需要找到所有表width=230
到目前为止,我有:
foreach($qp->top('table')->get() as $table) {
$width = $table->attr('width');
}
但我得到一个"Call to undefined method DOMElement::attr()"
错误。
尝试类似的东西
$table->find('[width="230"]');
看来, $table 是一个DOMElement,所以可能你可以做
$width = $table->getAttribute('width);