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

System.InvalidOperationException: Sequence contains no elements #6

Open
mushramb0 opened this issue Jun 14, 2018 · 2 comments
Open

Comments

@mushramb0
Copy link

hi,my ide is vs2017,netcore 2.1,c#7.3
when i run this code,it throw a exception
Console.WriteLine($"{itt.QuerySelectorAll("img.img[width]")?.Count()}"); Console.WriteLine($"{itt.QuerySelectorAll("img.img[height]")?.Count()}"); Console.WriteLine($"{itt.QuerySelectorAll("img.img[width][height]")?.Count()}");
output is
3
3
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable1 source) at HtmlAgilityPack.CssSelectors.NetCore.Token..ctor(String word) at HtmlAgilityPack.CssSelectors.NetCore.Token.<>c.<.ctor>b__8_0(String i) at System.Linq.Enumerable.SelectListPartitionIterator2.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at HtmlAgilityPack.CssSelectors.NetCore.Token..ctor(String word) at HtmlAgilityPack.CssSelectors.NetCore.Tokenizer.GetTokens(String cssFilter)+MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator2.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at HtmlAgilityPack.CssSelectors.NetCore.HapCssExtensionMethods.QuerySelectorAll(IEnumerable1 nodes, String cssSelector)
it seems not support css [][]

@akaero
Copy link

akaero commented Jan 21, 2019

have same problem

@BoricuaEnLaLuna
Copy link
Contributor

I have addressed this issue in my PR here: #9

Hopefully someone with privileges merges this into master

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

3 participants