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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ong_chrome_automation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3977d855f2f5c110c4736ffa1673fd917a2d0139f72504c0247dddf63933fa
MD5 ccf61ead168b493545a8c5d2b28ee83d
BLAKE2b-256 05e0cfd675767b78dd42721c942350c45384f642f9b787f4a28f56844df53473

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