Metadata-Version: 2.4
Name: pywebflx
Version: 0.1.3
Summary: Browser automation for already-open Chrome pages via Extension + WebSocket
Author-email: Flexa <the.flexa@outlook.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/theflexa/pywebflx
Project-URL: Documentation, https://theflexa.github.io/pywebflx/
Project-URL: Repository, https://github.com/theflexa/pywebflx
Project-URL: Issues, https://github.com/theflexa/pywebflx/issues
Keywords: browser,automation,chrome,rpa,websocket,scraping
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Classifier: Framework :: AsyncIO
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websockets>=12.0
Requires-Dist: loguru>=0.7.0
Requires-Dist: click>=8.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-mock>=3.12; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# PyWebFlx

**Automação de navegador para páginas Chrome já abertas.**

PyWebFlx conecta a páginas já abertas no Chrome via uma extensão (Manifest V3) + WebSocket. Diferente do Selenium, não cria sandbox — você automatiza o navegador real.

## Instalacao

```bash
pip install pywebflx
pywebflx install-extension
```

## Quick Start

```python
import asyncio
from pywebflx import use_browser

async def main():
    async with use_browser(url="https://quotes.toscrape.com/") as browser:
        # Inspect — entender a pagina
        print(await browser.inspect(depth=5))

        # Extrair dados
        quotes = await browser.extract_data(
            container="body",
            row=".quote",
            columns={"texto": ".text", "autor": ".author"}
        )
        for q in quotes:
            print(f"{q['autor']}: {q['texto'][:60]}...")

asyncio.run(main())
```

## Principais funcionalidades

| Metodo | Descricao |
|--------|-----------|
| `use_browser()` | Conecta a aba por URL/titulo, abre se nao existir |
| `click()` | Clica (CSS, XPath ou texto) |
| `type_into()` | Digita em campos |
| `get_text()` | Extrai texto de elemento |
| `extract_data()` | Extrai dados estruturados (cards, listas) |
| `extract_table()` | Extrai tabelas HTML com paginacao |
| `inspect()` | Visao resumida do DOM (otimizado pra IA) |
| `wait_element()` | Espera elemento aparecer |
| `execute_js()` | Executa JavaScript na pagina |

## Documentacao

[https://theflexa.github.io/pywebflx/](https://theflexa.github.io/pywebflx/)

## Licenca

MIT
