The other day I found myself addicted to a Flash game and frustrated by the thing at the same time. In a moment of frustration with the game I thought I would make a 'bot' to beat it for me. Well, I really wouldn't, but it made me realize: I don't know how to interact with another application in a way to do this. Which brings me to the question, how would one take screenshots of another running application and interact with it with the keyboard and mouse. Ideally the solution would be in a managed language like c#.
When doing the background reading the net was drowning with articles on scraping HTML. There were not many articles on actually screen scraping an application.
Diverse answers are appreciated as I’m really looking at surveying what’s out there.
UPDATE
I'm looking for a way to interface with another application rather than script/macro another application.
UPDATE
Could something like Xming be used to redirect the interface? http://www.straightrunning.com/XmingNotes/
Perhaps a Terminal Services client? http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx
Screen scraping is the act of copying information that shows on a digital display so it can be used for another purpose. Visual data can be collected as raw text from on-screen elements such as a text or images that appear on the desktop, in an application or on a website.
One useful feature of RPA tools is screen scraping. Screen scraping involves capturing bitmap data from the screen and cross-checking it against stored information to decipher it.
Web scraping is the process of using bots to extract content and data from a website. Unlike screen scraping, which only copies pixels displayed onscreen, web scraping extracts underlying HTML code and, with it, data stored in a database. The scraper can then replicate entire website content elsewhere.
Check out Sikuli, it is basically what you are looking for. It is written in Java however.
http://groups.csail.mit.edu/uid/sikuli/
I ended up making the bot which did all this and documented it in a post
http://www.charlesrcook.com/archive/2010/09/05/creating-a-bejeweled-blitz-bot-in-c.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With