fix: crawler strategy exception handling and fixes (#271)

This commit is contained in:
程序员阿江(Relakkes)
2024-11-20 20:30:25 +08:00
committed by GitHub
parent d418a04602
commit 3439f7886d

View File

@@ -283,7 +283,7 @@ class LocalSeleniumCrawlerStrategy(CrawlerStrategy):
print(f"[LOG] ✅ Crawled {url} successfully!")
return html
except InvalidArgumentException:
except InvalidArgumentException as e:
if not hasattr(e, 'msg'):
e.msg = sanitize_input_encode(str(e))
raise InvalidArgumentException(f"Failed to crawl {url}: {e.msg}")