Update internet.py

This commit is contained in:
Saifeddine ALOUI 2024-07-29 16:33:03 +02:00 committed by GitHub
parent 199c9e20be
commit 01d70e636d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,7 +152,7 @@ def scrape_and_save(url, file_path:str|Path=None, use_selenium=False, follow_lin
# Save scraped texts to the markdown file
if file_path:
with open(file_path, 'w') as md_file:
with open(file_path, 'w', encoding="utf8", errors='ignore') as md_file:
for text in results['texts']:
md_file.write(text + '\n\n')
print(f"Texts saved to {file_path}")