View Single Post
Old May 24th, 2006, 9:35 AM   #147
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by zem52887
also, in some cases, companies don't have a fax number posted or a phone number, does this mean I'm going to have to write if-statements in addition?
Maybe. You might be able to say something like: "Get all text in the second column in the table that has the text 'Address:' in it.".
Quote:
Originally Posted by zem52887
Also, now that I have isolated the table that contains the relevent data, how can I parse through that as opposed to the whole page?
Just treat it in the same way you would the whole page. contacttable.firstText() will only find text in the contact table, and contacttable.fetch("tr") will get all the table rows in the contact table (not the whole document).

With fetch("tr") and fetch("td") you can get specific cells from a table. So you could get a cell from the second row in the first column, or, with a list comprehension, you could get all of the text in a certain column or row, joined together.
Arevos is offline   Reply With Quote