我正在尝试从已解析的网站中移除所有链接,该网站已将一个div删除并放置在主代码中。问题在于我正试图删除提取的div中的所有“href”链接,但无法找到任何方法。我尝试使用CSS,在Chrome中可以工作,但我必须使用IE。我已经查看了“php简单html dom”解析器,以查看是否可以在文件保存之前完成此操作,但无法使其工作。所以我的最后一招是使用'jquery',但问题在于要删除的链接是从文件中提取的,而不是直接在代码中。如果有人能帮我,我会非常感激。以下是我正在使用的代码。
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="content-language" content="en">
<meta name="viewport" content="width=500" />
<title>example News</title>
<link rel="stylesheet" type="text/css" href="site/wwwRand1.css">
<?php
include( 'site/simple_html_dom.php');
$html=file_get_html( 'http://example.com/home.php');
$html->save('site/result.htm')
?>
<script type="text/javascript" src="site/jquery.js"></script>
<script type="text/javascript">
$('document').ready(function() {
$('#postsArea').load('site/result.htm #postsArea');
});
</script>
</head>
<body>
<div id="wrap">
<div id="postsArea"></div>
</div>
</body>