@@ -42,7 +42,7 @@ private static string GetAnalysis(IDocument doc)
4242
4343 nodes . AddRange ( nodes2 ) ;
4444
45- if ( ! nodes . Any ( ) ) {
45+ if ( nodes . Count == 0 ) {
4646 return null ;
4747 }
4848
@@ -199,7 +199,7 @@ public override async Task<SearchResult> GetResultAsync(SearchQuery query, Cance
199199 /// <summary>
200200 /// Parses <em>Similar images</em>
201201 /// </summary>
202- private IEnumerable < SearchResultItem > ParseSimilarImages ( IDocument doc , SearchResult r )
202+ private List < SearchResultItem > ParseSimilarImages ( IParentNode doc , SearchResult r )
203203 {
204204 var nodes = doc . QuerySelectorAll ( Serialization . S_Yandex_SimilarImages ) ;
205205 var results = new List < SearchResultItem > ( nodes . Length ) ;
@@ -225,15 +225,15 @@ private IEnumerable<SearchResultItem> ParseSimilarImages(IDocument doc, SearchRe
225225 /// <summary>
226226 /// Parses <em>Sites containing information about the image</em>
227227 /// </summary>
228- private static IEnumerable < SearchResultItem > ParseExternalInfo ( IDocument doc , SearchResult r )
228+ private static List < SearchResultItem > ParseExternalInfo ( IDocument doc , SearchResult r )
229229 {
230230 var items = doc . Body . SelectNodes ( Serialization . S_Yandex_ExtInfo ) ;
231231 var rg = new List < SearchResultItem > ( items . Count ) ;
232232
233233 foreach ( INode item in items ) {
234234 if ( item is IHtmlElement elem ) {
235235 var title1 = elem . QuerySelector ( ".CbirSites-ItemTitle" ) ;
236- var href1 = title1 . Children [ 0 ] . Attributes [ "href" ] ;
236+ // var href1 = title1.Children[0].Attributes["href"];
237237 }
238238 // var thumb = item.ChildNodes[0];
239239 var info = item . ChildNodes [ 1 ] ;
@@ -263,18 +263,18 @@ private static IEnumerable<SearchResultItem> ParseExternalInfo(IDocument doc, Se
263263 public override void Dispose ( ) { }
264264
265265 protected override string [ ] ErrorBodyMessages
266- => new [ ]
267- {
266+ =>
267+ [
268268 "Please confirm that you and not a robot are sending requests" ,
269- "Изображение не загрузилось, попробуйте загрузить другое." ,
269+ "Изображение не загрузилось, попробуйте загрузить другое."
270270 // "No matching images found"
271- } ;
271+ ] ;
272272
273273 protected override async ValueTask < INode [ ] > GetNodes ( IDocument doc )
274274 {
275275 var tagsItem = doc . Body . SelectNodes ( NodesSelector ) ;
276276
277- if ( ! tagsItem . Any ( ) ) {
277+ if ( tagsItem . Count == 0 ) {
278278 // return await Task.FromResult(Enumerable.Empty<INode>());
279279 return await Task . FromResult ( tagsItem . ToArray ( ) ) . ConfigureAwait ( false ) ;
280280 // return tagsItem;
0 commit comments