Not support node array select. xpath("span[2]/small/text()")
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 474
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
Not support node array select. "span[2]"
Example:
page.getHtml().xpath("span[2]/small/text()");
XPathParser.java add code, I suggest:
private Evaluator consumePredicates(String queue) {
// +++ start add code ++++
if(StringUtils.isNumericSpace(queue)) {
return new XEvaluators.IsNthOfType(0, Integer.parseInt(queue.trim()));
}
// +++ end add code ++++
XTokenQueue predicatesQueue = new XTokenQueue(queue);
EvaluatorStack evaluatorStack = new EvaluatorStack();
Operation currentOperation = null;
predicatesQueue.consumeWhitespace();
while (!predicatesQueue.isEmpty()) {
...
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in XPathParser.java, focusing on consumePredicates and the handling of numeric predicate text. Reproduce page.getHtml().xpath("span[2]/small/text()") and verify that the result selects the second span and its small text; existing parser tests should confirm the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100