主题名:英文小说章节内容

比如我得到这样的数据:

<?xml version="1.0" encoding="UTF-8"?>

<内容>
    <item>
        <文本>  


&lt;!--
google_ad_client = "pub-0119746079916199";
/* tingroom-300x250 */
google_ad_slot = "4893100664";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;

London, February, 1896.&lt;!--
google_ad_client = "pub-0119746079916199";
google_alternate_ad_url = " http://www.tingroom.com/ad/728.htm";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-11-01: ting-728
google_ad_channel = "4358875055";
//--&gt;

  
    欢迎访问英文小说网http://novel.tingroom.com
    只需30秒,测测你的英语词汇量!
  

</文本>
    </item>
</内容>

我想要在xpath中去掉

&lt;!--
google_ad_client = "pub-0119746079916199";
/* tingroom-300x250 */
google_ad_slot = "4893100664";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;




欢迎访问英文小说网http://novel.tingroom.com
只需30秒,测测你的英语词汇量!


在xpath中去掉这部分注释的内容和页脚该怎么做呢?




举报 使用道具
| 回复

共 1 个关于本帖的回复 最后回复于 2016-11-21 14:15

沙发
HJLing 版主 发表于 2016-11-21 14:15:32 | 只看该作者
如果每个页面都一样 那可以用xpath函数substring-before和substring-after
参考教程《xpath常用函数用法
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

精彩推荐

  • Gephi社会网络分析-马蜂窝游记文本分词并同
  • Gephi社会网络分析-基于马蜂窝游记文本以词
  • 知乎话题文本根据词语间距筛选后生成共词矩
  • 马蜂窝游记文本分词后以词语间距为筛选条件
  • 学习使用apriori算法挖掘关联关系

热门用户

GMT+8, 2024-5-7 22:42