From eb09f2718fdc23e911ca8500bada4a1161d03776 Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Wed, 9 Jul 2025 15:03:16 -0300 Subject: [PATCH] Use environment variable to initialize `scrapegraph_py.Client` (#362) This commit fixes a bug where `SCRAPEGRAPH_API_KEY` were never used to initialize `scrapegraph_py.Client`. --- .../tools/scrapegraph_scrape_tool/scrapegraph_scrape_tool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crewai_tools/tools/scrapegraph_scrape_tool/scrapegraph_scrape_tool.py b/src/crewai_tools/tools/scrapegraph_scrape_tool/scrapegraph_scrape_tool.py index 04a544fa6..34f42e52e 100644 --- a/src/crewai_tools/tools/scrapegraph_scrape_tool/scrapegraph_scrape_tool.py +++ b/src/crewai_tools/tools/scrapegraph_scrape_tool/scrapegraph_scrape_tool.py @@ -102,9 +102,8 @@ class ScrapegraphScrapeTool(BaseTool): "`scrapegraph-py` package not found, please run `uv add scrapegraph-py`" ) - self._client = Client(api_key=api_key) - self.api_key = api_key or os.getenv("SCRAPEGRAPH_API_KEY") + self._client = Client(api_key=self.api_key) if not self.api_key: raise ValueError("Scrapegraph API key is required")