We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I have found that the xpath
//div[@data-hveid and @class='g']
does not work, returns 0 elements
but the xpath
//div[@class='g' and @data-hveid]
does work, returning 1 element. The code example is below (jsoup 1.11.3, xsoup 0.3.1).
`
String html = "<!DOCTYPE html>" + "<html>" + " <head>" + " <title>test</title>" + " </head>" + " <body>" + " <div class=\"g\" data-hveid=\"CAYQAA\">" + " </div>" + " </body>" + "</html>"; Document document = Jsoup.parse(html); // does not work String xpath = "//div[@data-hveid and @class='g']"; // does work //String xpath = "//div[@class='g' and @data-hveid]"; XElements elements = Xsoup.compile(xpath).evaluate(document); System.out.println(elements.getElements().size()); for (Element element : elements.getElements()) { System.out.println(element.toString()); }
I think it should work both ways.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I have found that the xpath
//div[@data-hveid and @class='g']
does not work, returns 0 elements
but the xpath
//div[@class='g' and @data-hveid]
does work, returning 1 element. The code example is below (jsoup 1.11.3, xsoup 0.3.1).
`
`
I think it should work both ways.
The text was updated successfully, but these errors were encountered: