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

unexpexred SelectorParseException #43

Open
KEN-00 opened this issue Mar 25, 2019 · 0 comments
Open

unexpexred SelectorParseException #43

KEN-00 opened this issue Mar 25, 2019 · 0 comments

Comments

@KEN-00
Copy link

KEN-00 commented Mar 25, 2019

My query is:
( //script | //*[@id] | //*[@class] | //*[@for] )
My query works on Selenium. But when I try to run the query to get a list of jsoup Elements by the following function:

	public static void normaliseHtmlDom(Document htmlDom) throws ConfigInitializationException {
		Elements elements = htmlDom.getAllElements();
		Elements ignoredElements = Xsoup.compile(ConfigUtils.getInstance().getIgnoredXPathUnion()).evaluate(htmlDom).getElements();
		for(Element element : elements) {
			if(ignoredElements.contains(element)) {
				elements.remove(element);
			}
		}
		
//		normaliseElementsByTagNames(elements);
//		normaliseElementsByAttributeNames(elements);
	}

The following Exception is thrown:
org.jsoup.select.Selector$SelectorParseException: Could not parse query '( //script | //*[@id] | //*[@class] | //*[@for] )': unexpected token at '( //script | //*[@id] | //*[@class] | //*[@for] )'

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

1 participant