March 10th, 2013, 09:30 PM
I think you need a better tutorial. The program is too complicated.
from urllib import urlopen
webpage = urlopen('http://www.kayak.com/h/rss/deals').read()
patFinderTitle = re.compile('<title>(.*)</title>')
titles = patFinderTitle.findall(webpage)
for (i,title,) in enumerate(titles):
print('title %2d: %s'%(i,title,)
Run this program, you'll see there are 8 titles, indexes 0 through 7. With the crazy list iterator you were trying to access the unavailable indexes 8 and 9 causing, appropriately, IndexError.
[/code] are essential for python code!