File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,16 @@ public static List<HtmlNode> GetBuildingNodes(HtmlDocument doc)
11
11
{
12
12
var villageContentNode = doc . GetElementbyId ( "village_map" ) ;
13
13
if ( villageContentNode is null ) return new ( ) ;
14
- return villageContentNode . Descendants ( "div" ) . Where ( x => x . HasClass ( "buildingSlot" ) ) . ToList ( ) ;
14
+ var list = villageContentNode . Descendants ( "div" ) . Where ( x => x . HasClass ( "buildingSlot" ) ) . ToList ( ) ;
15
+ if ( list . Count == 22 ) return list ;
16
+ list . RemoveAt ( 22 ) ;
17
+ return list ;
15
18
}
16
19
17
20
public static int GetId ( HtmlNode node )
18
21
{
19
22
var classess = node . GetClasses ( ) ;
20
- var needClass = classess . FirstOrDefault ( x => x . StartsWith ( "aid " ) ) ;
23
+ var needClass = classess . FirstOrDefault ( x => x . StartsWith ( "a " ) ) ;
21
24
if ( string . IsNullOrEmpty ( needClass ) ) return - 1 ;
22
25
var strResult = new string ( needClass . Where ( c => char . IsDigit ( c ) ) . ToArray ( ) ) ;
23
26
if ( string . IsNullOrEmpty ( strResult ) ) return - 1 ;
You can’t perform that action at this time.
0 commit comments