Testing this type of program can be difficult if you don't have a permanent Internet connection. This program works around this by providing a mode where it loads data from a text file instead of from the Web. If the USE_TEST_FILE constants is defiend as True, the program reads data from a text file. Otherwise it uses the Internet Transfer control (Inet) to send a query to a Yahoo stock server and reads the results.
The following code builds a query string similar to the following, which fetches stock quotes for DIS, COKE, amd MCI:
It uses the Inet control's OpenURL method to open the URL and read the result. The result is text similar to the following:
Notice that this isn't HTML so it will probably confuse your browser. The program, however, has no trouble displaying the resulting text.