add scrape_web.

This commit is contained in:
刘棒棒 2024-01-15 18:09:56 +08:00
parent 4f93c5fad3
commit 00f7f93234
2 changed files with 27 additions and 0 deletions

View file

@ -76,6 +76,12 @@ TOOL_TYPE_MAPPINGS = {
desc="Related to text2image, image2image using stable diffusion model.",
usage_prompt="",
),
"scrape_web": ToolType(
name="scrape_web",
module="metagpt.tools.scrape_web",
desc="Scrape data from web page.",
usage_prompt="",
),
"other": ToolType(
name="other",
module="",

View file

@ -0,0 +1,21 @@
scrape_web:
type: async funciton
description: "Scrape and save the HTML structure and inner text content of a web page using Playwright."
parameters:
properties:
url:
type: str
description: "web url"
\*url:
type: Non-Keyword Arguments
description: "other web urls, you can assagin sub url link to it."
required:
- url
returns:
inner_text:
type: str
description: The inner text content of the web page.
html:
type: str
description: The html structure of the web page.