File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,17 @@ private async Task<bool> ClaimRewards(Account acc)
88
88
if ( ! result ) return false ;
89
89
}
90
90
91
- var collectNode = acc . Wb . Html . DocumentNode . Descendants ( "button" ) . FirstOrDefault ( x => x . HasClass ( "collect" ) ) ;
92
- if ( collectNode == null ) return true ;
91
+ var collectNodes = acc . Wb . Html . DocumentNode . Descendants ( "button" ) . Where ( x => x . HasClass ( "collect" ) ) ;
92
+ if ( collectNodes . Count ( ) == 0 ) return true ;
93
93
94
- var collectElement = acc . Wb . Driver . FindElement ( By . XPath ( collectNode . XPath ) ) ;
95
- collectElement . Click ( ) ;
96
- if ( StopFlag ) return false ;
94
+ foreach ( var node in collectNodes )
95
+ {
96
+ var collectElement = acc . Wb . Driver . FindElement ( By . XPath ( node . XPath ) ) ;
97
+ collectElement . Click ( ) ;
98
+ if ( StopFlag ) return false ;
97
99
98
- await AccountHelper . DelayWait ( acc , 5 ) ;
100
+ await AccountHelper . DelayWait ( acc , 5 ) ;
101
+ }
99
102
100
103
{
101
104
var result = await Update ( acc ) ;
You can’t perform that action at this time.
0 commit comments