webmagic的xpath中last()函数无法使用?
本文介绍了webmagic的xpath中last()函数无法使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
使用爬虫的时候,执行以下语句: page.getHtml().xpath("//div[@id='pager']/a[last()]").links().all()
报错如下:
org.jsoup.select.Selector$SelectorParseException: Could not parse query 'a[last()]': unexpected token at 'last()'
是否webmagic目前不支持last()函数?
解决方案
目前应该是不支持last()函数。
参考链接如下:
这篇关于webmagic的xpath中last()函数无法使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文