Recently I was interested in making a stock bot as a neat project for myself. It would run on a virtual stock exchange account, not using real money of course. The biggest problem I have run into is getting data to and from websites as I have no idea how to do this.

What I want to do is have the bot go down a list. First it would have to be able to get the browser to access the website and then it would have to go onto the page and interpret the data.

It would save these stock symbols and then another piece of the program would open another browser and look up the stock symbols. This program would then read various values on the page and decide whether it is to buy or not.

The sell section would open yet another web page and locate the correct form in which to submit the data and know to enter to finalize the transaction.

Taking this one piece at a time, I figured that for Ubuntu every program has some number indicator, as seen in the system monitor. Now I am unsure on how to use ASM in Ubuntu to execute programs. And even if the program was executed how can I tell Firefox which website I want to go to, how to refresh, and how to get the information off the page. I had figured that the computer saves all internet pages as temporary files and that the program could access these files and determine the data inside. As I am unsure could some one give me the general idea on how a ASM program would do this or if there is an easier way.

Well yes, there are plenty of easier ways!

Firstly, there's no need to invoke a browser just to get data from a web page.

Second, this is basically a text processing exercise (if you discount trying to do it the really hard way by reading the screen or something). So use a text processing language like perl.

There are (too many) libraries for performing analysis of HTML files. Using a couple of these, you can grab a web page and produce a neatly parsed result (internal to the program) in just a few lines of code.
Then it's just a matter of traversing the document representation to find what you need.

This article has been dead for over six months. Start a new discussion instead.