View Single Post
Old May 17th, 2006, 2:18 PM   #32
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
I've always thought of programming as the art of breaking a problem up into pieces. You take a problem, and keep breaking it up into smaller and smaller parts until you find a solution.

The way I see it, the end program you create will have three steps:

1. Get the links for each industry
2. For each industry link, get the links for each company listed
3. For each company, find out the information you need from the company's page

In the majority of programming languages, you can use functions to store code that you'll be using more than once. Your program should have at least three functions, one for each step. The Python tutorial will tell you how to create your own functions.

Once you've scraped all this data from your page, then you have to put it into a CSV file. This is the easiest part. CSV stands for "Comma Separated Value", and is as simple a file format as you might imagine:
Alpha, Beta, Gamma
One, Two, Three
When you import this into Excel, you should get a spreadsheet with six cells. The top left (A1) will contain "Alpha", the bottom right (C2) will contain "Three".

You can also use characters other than commas, such as the "|" character.
Arevos is offline   Reply With Quote