markdown-crawler
markdown-crawler copied to clipboard
UnicodeEncodeError : 'charmap' codec can't encode characters in position 2473-2474: character maps to
The error occurs in the crawl function in the init.py file, specifically in the section where markdown content is written to a file. Here is the relevant code excerpt:
# line 140
with open(file_path, 'w') as f:
f.write(output)
To resolve this issue, I suggest specifying the encoding when opening the file for writing. Here is the corrected code:
with open(file_path, 'w', encoding='utf-8') as f:
f.write(output)
By adding encoding='utf-8' to the open() function, Python will use UTF-8 encoding when writing the file, which should prevent the UnicodeEncodeError.
nice bro, same problem :)))