vendredi 15 avril 2016

What tools can be used to automatically navigate a website with HTML5 canvas? [on hold]

For the purpose of self-education (and fun of course) i'm trying to automate a play process in a certain web game, which is essentially a website which allows you to play using an HTML5 canvas element and then gives you the results as a regular (i.e. not using the canvas) webpage.

The algorithm i wanna implement is roughly like this:

  1. Open the website and log into my profile.
  2. Navigate to the page with the game and launch it.
  3. Scan the input data provided by the game and drawn on the canvas element.
  4. Play the game by performing actions that are expected to be done with a mouse (moving the cursor around, clicking and holding the mouse buttons etc).
  5. Parse the output data generated by the game, correct the playing strategy if needed.
  6. Go to step 2 and repeat.

I'm an experienced software developer, but never coded anything substantial for the web, nor have i ever done any website automation. So i don't have any preferences about the possible tools that can do the job i described. But while i welcome suggestions of just about any tool that could get the job done, there are several "is it possible" things that i'm curious about.

So, is it possible:

  1. To extract data drawn on HTML5 canvas without employing computer vision, i.e. by maybe somehow intercepting the client-side code that draws on it and receiving the game input data directly instead of analyzing the drawn image?
  2. To make the actual gameplay visible, as if the browser (or any other piece of software capable of rendering a webpage) was playing the game on itself? I kinda want to watch the matches go =).
  3. To retain some information between matches, so that the automatic playing algorithm could learn from its mistakes and adapt?

Any suggestions would be appreciated. Thanks!




Aucun commentaire:

Enregistrer un commentaire