我需要使用width=230查找所有表格
到目前为止,我有:
foreach($qp->top('table')->get() as $table) {
$width = $table->attr('width');
}但是我得到了一个"Call to undefined method DOMElement::attr()"错误。
发布于 2012-09-05 04:12:12
试试像这样的东西
$table->find('[width="230"]'); 发布于 2013-01-26 07:08:18
看起来,$table是一个DOMElement,所以你可以这样做
$width = $table->getAttribute('width);https://stackoverflow.com/questions/10825525
复制相似问题