Skip to content

【enhance】Add support for css4 #530

Description

@RussiaVk

htmlunit seem not support css4:

	public static void main(String[] args) throws IOException {
		try (WebClient webClient = new WebClient(BrowserVersion.CHROME)) {
			webClient.getOptions().setJavaScriptEnabled(false);
			webClient.getOptions().setUseInsecureSSL(true);
			webClient.getOptions().setCssEnabled(true);
			webClient.getOptions().setThrowExceptionOnScriptError(false);
			final HtmlPage page = webClient.loadHtmlCodeIntoCurrentWindow(
					"<html><head><meta content='码云,Gitee,代码托管,git,开源,内源,开源项目托管,免费代码托管,Git代码托管,企业代码管理' name='Keywords'></head><body></body></html>");
			String tags = Optional.ofNullable(page
					.querySelector("[name='keywords' i]")).map(v -> (HtmlMeta) v)
					.map(HtmlMeta::getContentAttribute).orElseGet(() -> StringUtils.EMPTY);
			System.out.println(tags);
		} 
	}

throw:
com.gargoylesoftware.css.parser.CSSException: Invalid selectors: [name='keywords' i]

http://www.w3.org/TR/selectors4/#attribute-case

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions