View Single Post
Old May 23rd, 2006, 11:45 AM   #125
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Well, presumably, if BeautifulSoup's fetchText function returns an empty list (an empty list is []), then it has found no text that says "Financial Highlights". So you could do something like:

highlights = soup.fetchText(re.compile("Financial Highlights"))

if highlights == []:
   # There are no financial highlights
(Note the double equals (==). This tells Python you want to compare two values, rather than assign one value to another.)
Arevos is offline   Reply With Quote