0
我正在使用HTMLAgilityPack,并试图选择一个冒号的元素ID。Fizzler HTMLAgilityPack c#CSS选择器与冒号
Using Fizzler.Systems.HtmlAgilityPack;
测试#1(未知伪类)
HtmlNodeSelection.QuerySelectorAll(_htmlDocument.DocumentNode,"#unlocktheinbox:test");
测试#2
HtmlNodeSelection.QuerySelectorAll(_htmlDocument.DocumentNode,"#unlocktheinbox\\:test");
试验#3(无法识别的转义序列)
(在位置16的无效字符)HtmlNodeSelection.QuerySelectorAll(_htmlDocument.DocumentNode,"#unlocktheinbox\3A test");
测试#4(无效字符a t位置16.)
HtmlNodeSelection.QuerySelectorAll(_htmlDocument.DocumentNode,"#unlocktheinbox\\3A test");
我在做什么错?
原来我看着为Fizzler源代码..
// TODO Support full string syntax!
//
// string {string1}|{string2}
// string1 \"([^\n\r\f\\"]|\\{nl}|{nonascii}|{escape})*\"
// string2 \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*\'
// nonascii [^\0-\177]
// escape {unicode}|\\[^\n\r\f0-9a-f]
// unicode \\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?
//
它们不支持它尚未:(
你的第二和第四个方法都正确。我不知道他们为什么会失败。 – BoltClock
我同意,我认为第2次和第4次尝试也是正确的,但它不适用于HTMLAgilityPack。 – Henry