使用Ganon或任何其他库php删除属性

时间:2013-09-02 16:21:04

标签: php html-parsing ganon

我正在尝试使用Ganon修改DOM。

我的代码:

<?php

include 'ganon.php';

// Create DOM from URL or file
$html = file_get_dom('index.html');
echo $html('tr',2)->getPlainText();

我试图找到HTML表格中的第二行然后将其删除。我的问题是如何用Ganon做到这一点?

到目前为止我粗暴的尝试不起作用:

$html('tr',2)->getPlainText()->deleteAttribute('tr');

0 个答案:

没有答案