File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ using OpenQA . Selenium ;
2
+ using System ;
2
3
using System . Collections . Generic ;
4
+ using System . Linq ;
3
5
using System . Threading . Tasks ;
4
6
using TbsCore . Helpers ;
5
7
using TbsCore . Models . AccModels ;
@@ -56,9 +58,19 @@ public override async Task<TaskRes> Execute(Account acc)
56
58
// No amount specified, meaning we have already equipt the item
57
59
if ( amount == 0 ) continue ;
58
60
await Task . Delay ( 900 ) ;
59
- await DriverHelper . WriteById ( acc , "amount" , amount ) ;
61
+ acc . Wb . UpdateHtml ( ) ;
62
+ var amountNode = acc . Wb . Html . GetElementbyId ( "amount" ) ;
63
+ if ( amountNode == null ) continue ;
64
+ var amountElement = acc . Wb . Driver . FindElement ( By . XPath ( amountNode . XPath ) ) ;
65
+ amountElement . SendKeys ( Keys . Home ) ;
66
+ amountElement . SendKeys ( Keys . Shift + Keys . End ) ;
67
+ amountElement . SendKeys ( $ "{ amount } ") ;
60
68
61
- await DriverHelper . ClickByClassName ( acc , "ok" ) ;
69
+ var okNode = acc . Wb . Html . DocumentNode . Descendants ( "button" ) . FirstOrDefault ( x => x . HasClass ( "ok" ) ) ;
70
+ if ( okNode == null ) continue ;
71
+ var okElement = acc . Wb . Driver . FindElement ( By . XPath ( okNode . XPath ) ) ;
72
+ okElement . Click ( ) ;
73
+ await Task . Delay ( 900 ) ;
62
74
HeroHelper . ParseHeroPage ( acc ) ;
63
75
}
64
76
You can’t perform that action at this time.
0 commit comments