- Fix Spacy model issue
- Update Readme and requirements.txt
This commit is contained in:
unclecode
2024-05-16 19:50:20 +08:00
parent 6a6365ae0a
commit c8589f8da3
8 changed files with 137 additions and 70 deletions

View File

@@ -9,10 +9,19 @@ import os
from html2text import HTML2Text
from .prompts import PROMPT_EXTRACT_BLOCKS
from .config import *
from pathlib import Path
class InvalidCSSSelectorError(Exception):
pass
def get_home_folder():
home_folder = os.path.join(Path.home(), ".crawl4ai")
os.makedirs(home_folder, exist_ok=True)
os.makedirs(f"{home_folder}/cache", exist_ok=True)
os.makedirs(f"{home_folder}/models", exist_ok=True)
return home_folder
def beautify_html(escaped_html):
"""
Beautifies an escaped HTML string.