I am getting the "expected string or buffer" error in my simple python file. I am trying to get the titles of reddit articles written down.
from urllib import urlopen
import re
worldNewsPage = urlopen("https://www.reddit.com/r/worldnews/")
collectTitle = re.compile('<p class="title"><a.*>(.*)</a>')
findTitle = re.findall(collectTitle, worldNewsPage)
listIterator = []
listIterator[:] = range(1,3)
for i in listIterator:
print findTitle
print