Add better error handling for Firefox binary not found error
This commit is contained in:
parent
341cbde833
commit
ea99b69e87
@ -204,7 +204,13 @@ def get_article_with_selenium(url):
|
|||||||
return article.text
|
return article.text
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Selenium failed for {url}: {str(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 ""
|
return ""
|
||||||
finally:
|
finally:
|
||||||
# Always quit the driver
|
# Always quit the driver
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user