try: pois = [] urls = read() for url in urls: file = 'https://pastebin.com/raw%s' % url print file text = GET(file).content # check for email addresses emails = re.findall(r'[\w\.-]+@[\w\.-]+', text) if len(emails) > 20: print 'Email addresses' pois.append(( file, 'email', text.encode('UTF-8'), )) continue # check for ip addresses followed by a port found = re.findall( r'(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3}:)', text) if len(found) > 20: print 'IP addresses' pois.append(( file, 'IP', text, )) continue