From 0eacf4e64723cf1241c1bbd21804d7a0c7fab151 Mon Sep 17 00:00:00 2001 From: Rubenperes <88197615+Rubenperes@users.noreply.github.com> Date: Tue, 13 Aug 2024 07:59:56 +0200 Subject: [PATCH] Update __init__.py Fix file encoding for the crawler --- markdown_crawler/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown_crawler/__init__.py b/markdown_crawler/__init__.py index 8f19d1d..7f78ca0 100644 --- a/markdown_crawler/__init__.py +++ b/markdown_crawler/__init__.py @@ -137,7 +137,7 @@ def crawl( # ------------------------------ # Write markdown content to file # ------------------------------ - with open(file_path, 'w') as f: + with open(file_path, 'w', encoding="utf-8") as f: f.write(output) else: logger.error(f'❌ Empty content for {file_path}. Please check your targets skipping.') @@ -356,4 +356,4 @@ def md_crawl( for t in threads: t.join() - logger.info('🏁 All threads have finished') \ No newline at end of file + logger.info('🏁 All threads have finished')