mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-22 14:48:13 +00:00
feat: add URL validation and return_html examples
- Add comprehensive URL validation in schema and _create_driver - Add URL format, length, and character validation - Add meaningful error messages for validation failures - Add return_html usage examples in README.md Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -24,6 +24,16 @@ tool = SeleniumScrapingTool(website_url='https://example.com', css_element='.mai
|
||||
|
||||
# Example 4: Scrape using optional parameters for customized scraping
|
||||
tool = SeleniumScrapingTool(website_url='https://example.com', css_element='.main-content', cookie={'name': 'user', 'value': 'John Doe'})
|
||||
|
||||
# Example 5: Scrape content in HTML format
|
||||
tool = SeleniumScrapingTool(website_url='https://example.com', return_html=True)
|
||||
result = tool._run()
|
||||
# Returns HTML content like: ['<div class="content">Hello World</div>', '<div class="footer">Copyright 2024</div>']
|
||||
|
||||
# Example 6: Scrape content in text format (default)
|
||||
tool = SeleniumScrapingTool(website_url='https://example.com', return_html=False)
|
||||
result = tool._run()
|
||||
# Returns text content like: ['Hello World', 'Copyright 2024']
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
Reference in New Issue
Block a user