Is there a way to click separate elements on a canvas (e.g. in a browser game) using selenium?

Viewed 69

I am trying to create a bot for https://5kings.ru/ which has to move on arena (it is displayed by a canvas).
enter image description here

Here is its code:

<canvas id="mapCanvas" width="252" height="138.5" onclick="MapClick(arguments[0])" onmousemove="mover(arguments[0]);" style="cursor: pointer;"> == $0

I want to click on the separate fields but I couldn't find a right tool. My code does basic click by Actions:

canvas = driver.find_element(By.ID, "mapCanvas")
actions.move_to_element(canvas).click().perform()

As I understand this is related to Javascript and Jquery, can these give a hint? Website's Jquery file: https://5kings.ru/jquery-2.1.3.js

0 Answers
Related