Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用Xpath的contains函数出现问题 #40

Open
yearn-for-wlb opened this issue May 25, 2018 · 1 comment
Open

使用Xpath的contains函数出现问题 #40

yearn-for-wlb opened this issue May 25, 2018 · 1 comment

Comments

@yearn-for-wlb
Copy link

yearn-for-wlb commented May 25, 2018

举例:https://club.autohome.com.cn/bbs/thread/86f2870bac840396/72293736-1.html
在浏览器审查元素-Console中输入
$x("//div[@class='conleft fl']/ul[@class='leftlist']/li[contains(text(),'帖子')]/a[1]/text()")
得到(7) [text, text, text, text, text, text, text]
而使用Webmagic集成的Xsoup
page.getHtml().xpath("//div[@class='conleft fl']/ul[@class='leftlist']/li[contains(text(),'帖子')]/a[1]/text()").all();
会得到一个空集合,求解

@seaLordsLiu
Copy link

image
包含没支持text()函数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants