Skip to content

Commit 5ee5b28

Browse files
committed
fix claim beginer 2021 cannot click all collect button
1 parent a0d326f commit 5ee5b28

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

TbsCore/Tasks/Sim/ClaimBeginnerTask2021.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@ private async Task<bool> ClaimRewards(Account acc)
8888
if (!result) return false;
8989
}
9090

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;
9393

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;
9799

98-
await AccountHelper.DelayWait(acc, 5);
100+
await AccountHelper.DelayWait(acc, 5);
101+
}
99102

100103
{
101104
var result = await Update(acc);

0 commit comments

Comments
 (0)