'How FAST give opencv browser screen(selenium)?

There is a game, where if you want to play you need to look all screen(all screen is a - canvas). How can I give this canvas to opencv FAST(0.1 sec upd)? Now I simply make screenshots of screen with selenium(drive.save_screenshot("foo.png")) but this way is too slow(0.3-0.5 sec).

Is there any way to save screenshots faster or other way to give opencv access to screen or smth else. Maybe I need to save screenshot as bytes but not as file to upd canvas faster?

Also I found this https://python-mss.readthedocs.io/examples.html#part-of-the-screen but I didn't find how to use it with selenium. Python.

Photo of canvas:enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source