Jul-19-2017, 08:56 PM
(Jul-17-2017, 05:35 PM)ekansh Wrote: my question here
import urllib import re urls=[] i=0 regex='<title>(.+?)</title>' pattern=re.compile(regex) while i<len(urls): htmlfile=urllib.urlopen(urls[i]) a=htmlfile.read() titles=re.findall(pattern,a) print titles i=i+1
It's a syntax error. If you run it, python will tell you what the problem is.