I'm using Python 2.7. When I try to run this code, I get a problem when the function hits print findPatTitle[i], and python returns "Index Error: list index out of range". I'm taking this code from the 13th python tutorial on youtube, and I'm pretty sure the code is identical, so I don't understand why I would get a range problem. Any ideas?
from urllib import urlopen
from BeautifulSoup import BeautifulSoup
import re
webpage = urlopen('http://feeds.huffingtonpost.com/huffingtonpost/LatestNews').read()
patFinderTitle = re.compile('<title>(.*)<title>')
patFinderLink = re.compile('<link rel.*href="(.*)" />')
findPatTitle = re.findall(patFinderTitle,webpage)
findPatLink = re.findall(patFinderLink,webpage)
listIterator = []
listIterator[:] = range(2,16)
for i in listIterator:
print findPatTitle[i]
print findPatLink[i]
print "\n"