Commit
·
d86d5f2
1
Parent(s):
5783560
Update extract_news/3_extract_news_txt.py
Browse files
extract_news/3_extract_news_txt.py
CHANGED
|
@@ -299,11 +299,9 @@ while True:
|
|
| 299 |
nb_base = formatted_keys.count(f'{key}|')
|
| 300 |
|
| 301 |
# Display
|
| 302 |
-
test =''
|
| 303 |
color = Fore.GREEN if len(content) > 200 else Fore.WHITE
|
| 304 |
if len(content) > 200 and nb_base:
|
| 305 |
color = Fore.CYAN
|
| 306 |
-
test = '' #f"[{title}]"
|
| 307 |
|
| 308 |
if len(content) > 200 and not nb_base:
|
| 309 |
cursor = connection.cursor()
|
|
@@ -312,5 +310,5 @@ while True:
|
|
| 312 |
save_to_file(f"{path}/sources/txt_news/{id_source}.txt", add)
|
| 313 |
|
| 314 |
elapsed_time = time.time() - time_start
|
| 315 |
-
print(color + f"{id_source:8}) ({extract_method:1}) [{elapsed_time:.3f}] [{len_source:7}{len_text:7}{len(content):7}{len(title):4} ] {url}
|
| 316 |
index_id = next_id
|
|
|
|
| 299 |
nb_base = formatted_keys.count(f'{key}|')
|
| 300 |
|
| 301 |
# Display
|
|
|
|
| 302 |
color = Fore.GREEN if len(content) > 200 else Fore.WHITE
|
| 303 |
if len(content) > 200 and nb_base:
|
| 304 |
color = Fore.CYAN
|
|
|
|
| 305 |
|
| 306 |
if len(content) > 200 and not nb_base:
|
| 307 |
cursor = connection.cursor()
|
|
|
|
| 310 |
save_to_file(f"{path}/sources/txt_news/{id_source}.txt", add)
|
| 311 |
|
| 312 |
elapsed_time = time.time() - time_start
|
| 313 |
+
print(color + f"{id_source:8}) ({extract_method:1}) [{elapsed_time:.3f}] [{len_source:7}{len_text:7}{len(content):7}{len(title):4} ] {url} ")
|
| 314 |
index_id = next_id
|