fix(explorer): resolve initialization and import errors for v0.7.0 backend

This commit is contained in:
2026-01-20 17:11:31 +00:00
parent d9cb096663
commit 58b30dc0ed
4 changed files with 160 additions and 921 deletions

View File

@@ -267,3 +267,15 @@ class ScraperService:
except Exception as e:
logger.error(f"Critical error in _parse_html: {e}", exc_info=True)
return {"title": "", "description": "", "text": "", "emails": [], "error": str(e)}
# --- HELPER FUNCTION FOR EXTERNAL USE ---
def scrape_website_content(url: str) -> Optional[str]:
"""
Simple wrapper to get just the text content of a URL.
Used by ClassificationService.
"""
scraper = ScraperService()
result = scraper.scrape_url(url)
if result and result.get("text"):
return result["text"]
return None