webmagic icon indicating copy to clipboard operation
webmagic copied to clipboard

xpath 语法解析问题

Open sin-ning opened this issue 8 years ago • 0 comments

java code

// 节点存在,查找不到。
String articleHtml = page.getHtml().xpath("//div[@class='article-content']/html()").get();

html code

// .. 省略 html 元素
<div class="article-content">
    // .. 省略
</div>

抓取网址:https://toutiao.com/i6530346164955382276

sin-ning avatar Mar 09 '18 02:03 sin-ning