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

Xsoup cannot compile valid xpath expression / ()[1] / first element #25

Open
timactive opened this issue Jun 17, 2016 · 0 comments
Open
Labels
Milestone

Comments

@timactive
Copy link

I need only the first element for a selector (div[@Class="fh-breadcrumb"])[1]. This expression work fine in chrome browser.

page.getHtml().xpath("//(div[@Class="fh-breadcrumb"])[1]//li").nodes();

But when i try i have this exception linked to Xsoup :

org.jsoup.select.Selector$SelectorParseException: Could not parse query '(div[@Class="fh-breadcrumb"])[1]': unexpected token at '(div[@Class="fh-breadcrumb"])[1]'
at us.codecraft.xsoup.xevaluator.XPathParser.findElements(XPathParser.java:166) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:76) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:408) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.xevaluator.XPathParser.combinator(XPathParser.java:110) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:74) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:408) ~[xsoup-0.3.1.jar:na]
at us.codecraft.xsoup.Xsoup.compile(Xsoup.java:25) ~[xsoup-0.3.1.jar:na]

Sorry i not view you have specific project for Xsoup.(so dupplicate with issue code4craft/webmagic#339)

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

No branches or pull requests

2 participants