Skip to main content

A CrewAI custom tool for automatically exporting multi-tab reports from portals using Playwright.

Project description

crewai-playwright-export

A custom CrewAI tool for automated multi-tab report exporting from portals using Playwright.

This tool logs into a specified web portal, automatically discovers all report subpage links, traverses them in separate browser tabs, performs scroll-based dynamic selector searching, exports the CSV reports, and manages download state and tab lifecycles.

Features

  • Multi-Tab Execution: Traverses and exports report pages in isolated browser tabs.
  • Session Auth Injection: Automatically propagates active session credentials (sessionStorage) into newly opened tabs to bypass redirect guards.
  • Automatic Navigation: Automatically traverses report lists to inner detail pages.
  • Dynamic Scrolling: Scrolls down in 300px increments to locate Export buttons.
  • Pydantic Validation: Input argument checking.

Installation

Install the package using pip:

pip install crewai-playwright-export

Ensure Playwright browser drivers are installed:

playwright install chromium

Usage

from crewai import Agent, Task, Crew
from crewai_playwright_export import ExportReportsTool

# Instantiate the custom tool
export_tool = ExportReportsTool()

# Define the Agent
automation_agent = Agent(
    role="Data Export Specialist",
    goal="Collect and export all tabular reports from the portal",
    backstory="An automated script operator specialized in extraction.",
    tools=[export_tool],
    verbose=True
)

# Define the Task
export_task = Task(
    description="Export all campaign performance reports from https://gokulraj-v12.github.io/InterEQ/",
    expected_output="Log of successful CSV exports.",
    agent=automation_agent,
)

# Run the Crew
crew = Crew(agents=[automation_agent], tasks=[export_task])
result = crew.kickoff()
print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crewai_playwright_export-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crewai_playwright_export-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file crewai_playwright_export-0.1.0.tar.gz.

File metadata

File hashes

Hashes for crewai_playwright_export-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05c944ebc5eb1b5b771808ead498f5e10d77da1ce3d55b32f5b04ea94ad733e7
MD5 7216bc6f2ac401e1554cd311c270a47c
BLAKE2b-256 8e6d05c5c0e94639685441e68e222c4412d15fef1b6bb365a8ecc430fd5a145f

See more details on using hashes here.

File details

Details for the file crewai_playwright_export-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_playwright_export-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3089d6bad816c1d3554fd03b3e322598d8d986bac168e95d18069d5372b071c8
MD5 29b36c05f07e03da3928cfe767fb0428
BLAKE2b-256 f39ec53c97fdb0554618dbdf0c4c1036f05fc83167c8c99bcc5a6fd17f6cd975

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page