Skip to content

Browse Tool

Applies to: 4.0.8.1+

Browse fetches a URL and extracts readable page text.

1) Initialization

python
from agently.builtins.tools import Browse

browse = Browse(
    proxy=None,
    timeout=20,
    headers=None,
)

2) Extraction strategy (current)

Browse now prioritizes main content and removes common noise:

  • main selectors first: main/article/.vp-doc/[role=main] etc.
  • noise removal: nav/aside/header/footer, sidebar/toc/navbar keywords
  • kept tags: headings, paragraphs, list items, code blocks, table cells

This reduces sidebar/navigation pollution on docs pages.

3) Direct usage

python
import asyncio
from agently.builtins.tools import Browse

browse = Browse(timeout=20)

async def main():
    content = await browse.browse("https://agently.tech/docs/en/triggerflow/overview.html")
    print(content)

asyncio.run(main())

4) Use with Agent

python
from agently import Agently
from agently.builtins.tools import Search, Browse

agent = Agently.create_agent()
search = Search(region="us-en")
browse = Browse(timeout=20)

agent.use_tools([search.search, browse.browse])

result = agent.input("What is Agently TriggerFlow? Search first and then browse sources.").start()
print(result)

5) Return value

  • success: extracted text string
  • failure: error string (contains Can not browse ...)

If you need strict downstream handling, wrap string errors into structured error objects at execution layer.