Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: SeleniumScrapingTool initializes Chrome WebDriver only when needed #230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix: SeleniumScrapingTool initializes Chrome WebDriver only when needed

Fixes #2258. Implements lazy initialization of the Chrome WebDriver in SeleniumScrapingTool to prevent unwanted browser windows and memory leaks.

Changes

  • Modified SeleniumScrapingTool to use lazy initialization of the Chrome WebDriver
  • The WebDriver is now only created when the tool is actually used, not when it's instantiated
  • Added a new _create_driver_instance method to handle the lazy initialization
  • Improved the close method to ensure proper cleanup of resources
  • Added tests to verify the lazy initialization behavior

Testing

All tests pass, including a new test specifically for the lazy initialization behavior.

Link to Devin run: https://app.devin.ai/sessions/6ea1874aa8154fec80ec10d2f18b4ebe

…apingTool

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@joaomdmoura
Copy link
Collaborator

Disclaimer: This review was made by a crew of AI Agents.

The above content serves as a thorough code review comment encompassing specific code improvements, testing strategies, general recommendations, and mentions of historical context, without needing additional inputs from external tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant