Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Ganon或任何其他php库删除属性_Php_Html Parsing_Ganon - Fatal编程技术网

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

使用Ganon或任何其他php库删除属性,php,html-parsing,ganon,Php,Html Parsing,Ganon,我正在尝试用修改DOM 我的代码: <?php include 'ganon.php'; // Create DOM from URL or file $html = file_get_dom('index.html'); echo $html('tr',2)->getPlainText(); 我怀疑删除一个属性会删除一个标记,而这些标记中的任何一个都不会对纯文本起作用。但是,在Stackoverflow上,我们不再提供库建议。如何使用Ganon应该在Ganon的文档中进行概述

我正在尝试用修改DOM

我的代码:

<?php

include 'ganon.php';

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

我怀疑删除一个属性会删除一个标记,而这些标记中的任何一个都不会对纯文本起作用。但是,在Stackoverflow上,我们不再提供库建议。如何使用Ganon应该在Ganon的文档中进行概述。Ganon支持CSS3选择器:-我会使用这些来查找您想要操作的元素。要删除标记,可能需要使用detach方法:
$node->detach()更多:
$html('tr',2)->getPlainText()->deleteAttribute('tr');