
How to give a CrewAI agent browser tools (screenshots, PDFs, page inspection)
How to Give a CrewAI Agent Browser Tools CrewAI agents collaborate in crews — researcher, writer, QA, analyst. What none of them can do by default is actually look at a web page, take a screenshot, or verify that a UI element exists. Here's how to add browser tools to any CrewAI agent using the PageBolt API. Install pip install crewai crewai-tools requests Define the tools CrewAI tools extend BaseTool and implement a _run method. One class per capability: import os import base64 import requests from crewai.tools import BaseTool from pydantic import Field from typing import Optional PAGEBOLT_API_KEY = os . environ [ " PAGEBOLT_API_KEY " ] BASE_URL = " https://pagebolt.dev/api/v1 " HEADERS = { " x-api-key " : PAGEBOLT_API_KEY , " Content-Type " : " application/json " } class ScreenshotTool ( BaseTool ): name : str = " take_screenshot " description : str = ( " Take a screenshot of any web page. " " Input: a full URL (e.g. https://example.com). " " Returns a confirmation with the image siz
Continue reading on Dev.to Webdev
Opens in a new tab




