mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-14 10:38:29 +00:00
feat: allow to provide the driver and options to be used by Selenium (#316)
This commit is contained in:
@@ -91,9 +91,16 @@ class SeleniumScrapingTool(BaseTool):
|
||||
"`selenium` and `webdriver-manager` package not found, please run `uv add selenium webdriver-manager`"
|
||||
)
|
||||
|
||||
options: Options = Options()
|
||||
options.add_argument("--headless")
|
||||
self.driver = webdriver.Chrome(options=options)
|
||||
if 'driver' not in kwargs:
|
||||
if 'options' not in kwargs:
|
||||
options: Options = Options()
|
||||
options.add_argument("--headless")
|
||||
else:
|
||||
options = kwargs['options']
|
||||
self.driver = webdriver.Chrome(options=options)
|
||||
else:
|
||||
self.driver = kwargs['driver']
|
||||
|
||||
self._by = By
|
||||
if cookie is not None:
|
||||
self.cookie = cookie
|
||||
|
||||
Reference in New Issue
Block a user