diff --git a/crawler.py b/crawler.py index 45ff143..26c3b71 100644 --- a/crawler.py +++ b/crawler.py @@ -49,12 +49,11 @@ def filteringcon(filters_regex_one): with open(filters_regex_one, 'r') as f: for line in f: for word in a: - if word in line and not line.startswith('#') and line.startswith((tuple(word))): + if word in line and not line.startswith('#') and line.startswith((tuple(word))) and not '.' in line: line = line.replace(word,'') - else: + elif '.' in line and not line.startswith('.'): line = line.replace(line, line) lst.append(line) - f.close() with open(filters_regex_one, 'w') as f: for line in lst: f.write(line)