本页还没有译文
本页 11 段还没译成Español,下面显示的是英文原文。Scrape Website
还没翻译译自英文(docs.crewai.com)本页 11 段都还没译
ScrapeWebsiteTool
Note
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
Description
A tool designed to extract and read the content of a specified website. It is capable of handling various types of web pages by making HTTP requests and parsing the received HTML content. This tool can be particularly useful for web scraping tasks, data collection, or extracting specific information from websites.
Fetches go through CrewAI's SSRF-safe HTTP helper: the requested URL and every redirect hop are checked against private and reserved ranges (including cloud metadata and shared address space such as Tailscale's 100.64.0.0/10), and the TCP connection is pinned to an IP that passed that check.
Installation
Install the crewai_tools package
pip install 'crewai[tools]'Example
from crewai_tools import ScrapeWebsiteTool
# To enable scrapping any website it finds during it's execution
tool = ScrapeWebsiteTool()
# Initialize the tool with the website URL,
# so the agent can only scrap the content of the specified website
tool = ScrapeWebsiteTool(website_url='https://www.example.com')
# Extract the text from the site
text = tool.run()
print(text)Arguments
| Argument | Type | Description |
|---|---|---|
| website_url | string | Mandatory website URL to read the file. This is the primary input for the tool, specifying which website's content should be scraped and read. |