Add better error handling for Firefox binary not found error

This commit is contained in:
Jarian Cottingham 2026-01-31 11:34:50 -06:00
parent 341cbde833
commit ea99b69e87

View File

@ -204,6 +204,12 @@ def get_article_with_selenium(url):
return article.text
except Exception as e:
# Check if this is a Firefox binary not found error
error_str = str(e).lower()
if "binary is not a firefox executable" in error_str or "firefox" in error_str:
logger.error(f"Firefox not found or not properly configured for {url}: {str(e)}")
logger.error("Please ensure Firefox is installed and properly configured in PATH")
else:
logger.error(f"Selenium failed for {url}: {str(e)}")
return ""
finally: