From f622286ae5618265949e413e4fb24cfe27e6e9ea Mon Sep 17 00:00:00 2001 From: minoplhy Date: Thu, 12 Aug 2021 17:48:35 +0700 Subject: [PATCH] Fix . line --- crawler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)