Skip to main content

Class to automate Chrome browser tasks using Playwright. It adds a class to deal with Microsoft Copilot

Project description

ong_chrome_automation

Automate Chrome browser tasks using Playwright, with special support for Microsoft Copilot interactions (work copilot, not personal copilot).

Features

  • Launch and control a local Chrome browser using Playwright.
  • Support for client certificates (PFX/PKCS12) for secure sites.
  • Optional anti-detection (stealth) scripts.
  • High-level automation for Microsoft Copilot web chat:
    • Send messages and files.
    • Retrieve responses as text, HTML, tables (pandas DataFrames), code blocks, and downloadable files.
  • Example scripts for common Copilot automation tasks.

Requirements

  • Python >= 3.11
  • Google Chrome installed (default path: C:/Program Files/Google/Chrome/Application/chrome.exe)
  • See requirements.txt for Python dependencies.

Installation

pip install -r requirements.txt
playwright install

Usage

Basic Chrome Automation

from ong_chrome_automation import LocalChromeBrowser

with LocalChromeBrowser() as browser:
    browser.goto("https://example.com")

With Client Certificate

from ong_chrome_automation import LocalChromeBrowser
with LocalChromeBrowser(
    origin="https://your-server.com",
    pfxPath="./path/to/cert.pfx",
    passphrase="your-password"
) as browser:
    browser.goto("https://your-server.com")

Microsoft Copilot Automation

from ong_chrome_automation import LocalChromeBrowser, CopilotAutomation

with LocalChromeBrowser() as browser:
    copilot = CopilotAutomation(browser)
    copilot.chat("What is the capital of France?")
    print(copilot.get_text_response())

Project Structure

  • src/ong_chrome_automation/local_chrome_browser.py: Chrome browser automation class.
  • src/ong_chrome_automation/playwright_copilot.py: High-level Copilot automation.
  • requirements.txt: Python dependencies.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ong_chrome_automation-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ong_chrome_automation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1c85d4df0c4db3b048bcef08eb34677cd8a3c00ff058f31c46c26b86890d7f6
MD5 04a3a0b21149a424d76f144f072f3a5f
BLAKE2b-256 d85380ce35462d2b32686d300a3709b0327cebf0e6ff1a508e0dff41f2f0596a

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