I am trying to make a program which plays 2048 by randomly choosing arrow keys.
I tried something like this:
moves = [htmlElem.send_keys(Keys.UP),htmlElem.send_keys(Keys.RIGHT),htmlElem.send_keys(Keys.DOWN),htmlElem.send_keys(Keys.LEFT)]
while True:
random.choice(moves)
This is not working. I tried print(random.choice(moves))
, but it infinite loop of None
So how can I press arrows keys randomly using Selenium?
Aucun commentaire:
Enregistrer un commentaire