Class: WebPageScraper

WebPageScraper(agent)

new WebPageScraper(agent)

Parameters:
Name Type Description
agent Agent
Source:

Members

args :Object.<string, string>

Dictionary of arguments for the tool.

Type:
  • Object.<string, string>
Source:

resp :Object.<string, any>

Response format of the tool.

Type:
  • Object.<string, any>
Source:

Methods

(async) _addToMemory(pagetitle, results)

Parameters:
Name Type Description
pagetitle any
results Object
Source:

(async) run(args) → {Promise.<({text: (string|null), links: Array.<(string|null)>}|string)>}

Executes the web page scraping and summarization.

Parameters:
Name Type Description
args Array.<{url: string, question: string}> | Object
Source:
Returns:

The scraped data and summarized text.

Type
Promise.<({text: (string|null), links: Array.<(string|null)>}|string)>

(async) scrapeWebPage(url) → {Promise.<{text: (string|null), links: Array.<(string|null)>}>}

Scrapes a web page using the provided URL.

Parameters:
Name Type Description
url string

The URL of the web page.

Source:
Returns:

The scraped data from the web page.

Type
Promise.<{text: (string|null), links: Array.<(string|null)>}>

(async) scrapeWebPageAPI(url, selector)

Parameters:
Name Type Description
url string
selector string
Source: