View Single Post
Old May 22nd, 2006, 12:04 PM   #109
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
It only searches within table 3. If you want to seach the whole site, use:
soup.fetch("td")
But if you just want to search a subsection (say, table 3), use:
soup.fetch("table")[3].fetch("td")
Indeed, it makes more sense if you think of it from a "what belongs to what" perspective. The first "fetch" belongs to the "soup" object. The second "fetch" belongs to the table 3 object. Thus, the first fetch searches the whole of the site, whilst the second just searches table 3.
Arevos is offline   Reply With Quote