Metadata-Version: 2.4
Name: ong_chrome_automation
Version: 0.1.1
Summary: Class to automate Chrome browser tasks using Playwright. It adds a class to deal with Microsoft Copilot
Author: Oscar Neira
Project-URL: Homepage, https://github.com/Oneirag/ong_chrome_automation
Project-URL: Repository, https://github.com/Oneirag/ong_chrome_automation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: playwright
Requires-Dist: wincertstore
Requires-Dist: cryptography
Requires-Dist: pywin32
Requires-Dist: python-dotenv
Requires-Dist: lxml
Requires-Dist: html5lib
Requires-Dist: pandas
Requires-Dist: pip-system-certs
Requires-Dist: playwright_stealth
Requires-Dist: beautifulsoup4

# 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

```bash
pip install -r requirements.txt
playwright install
```

## Usage

#### Basic Chrome Automation

```python
from ong_chrome_automation import LocalChromeBrowser

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

### With Client Certificate

```python
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

```python
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.
