File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,12 +61,16 @@ def login(self) -> None:
6161 self .__drivers .get ('https://www.chess.com/login' )
6262 while True :
6363 try :
64- bottom_banner = EC .presence_of_element_located ((By .CLASS_NAME , 'bottom-banner-close ' ))
65- WebDriverWait (self .__drivers , 1 ).until (bottom_banner )
64+ login_button = EC .presence_of_element_located ((By .ID , 'login ' ))
65+ WebDriverWait (self .__drivers , 1 ).until (login_button )
6666 break
6767 except : pass
6868
69- self .__drivers .find_element (By .CLASS_NAME , 'bottom-banner-close' ).click ()
69+ try :
70+ bottom_banner = EC .presence_of_element_located ((By .CLASS_NAME , 'bottom-banner-close' ))
71+ WebDriverWait (self .__drivers , 3 ).until (bottom_banner )
72+ self .__drivers .find_element (By .CLASS_NAME , 'bottom-banner-close' ).click ()
73+ except : pass
7074
7175 self .__drivers .find_element (By .ID , 'username' ).send_keys (self .__login )
7276 self .__drivers .find_element (By .ID , 'password' ).send_keys (self .__password )
@@ -285,7 +289,6 @@ def startNewGame(self):
285289
286290 while True :
287291 end_game , results = bot .isGameEnded (opponent_name , game )
288- #print(end_game, results)
289292 if end_game :
290293 if results == "win" :
291294 wins += 1
You can’t perform that action at this time.
0 commit comments