feat: app script_navegador y dashboard Metabase
App Go para ejecutar scripts de navegación automatizada usando las funciones CDP del registry. Incluye script de creación de dashboard en Metabase para monitoreo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
name: "busqueda_google"
|
||||
steps:
|
||||
- action: navigate
|
||||
url: "https://www.google.com"
|
||||
|
||||
- action: wait
|
||||
selector: "textarea[name=q]"
|
||||
timeout_ms: 8000
|
||||
|
||||
- action: type
|
||||
selector: "textarea[name=q]"
|
||||
text: "golang cdp automation"
|
||||
|
||||
- action: screenshot
|
||||
path: "/tmp/busqueda_antes.png"
|
||||
|
||||
- action: evaluate
|
||||
expr: "document.title"
|
||||
|
||||
- action: sleep
|
||||
ms: 500
|
||||
|
||||
- action: evaluate
|
||||
expr: "document.querySelector('textarea[name=q]').value"
|
||||
|
||||
- action: screenshot
|
||||
path: "/tmp/busqueda_despues.png"
|
||||
full_page: false
|
||||
@@ -0,0 +1,20 @@
|
||||
name: "demo_continue_on_error"
|
||||
steps:
|
||||
- action: navigate
|
||||
url: "https://example.com"
|
||||
|
||||
- action: wait
|
||||
selector: "h1"
|
||||
timeout_ms: 5000
|
||||
|
||||
# Este paso fallara porque el selector no existe, pero el script continua
|
||||
- action: click
|
||||
selector: "#boton-que-no-existe"
|
||||
continue_on_error: true
|
||||
|
||||
# Este paso se ejecuta aunque el anterior fallo
|
||||
- action: evaluate
|
||||
expr: "document.title"
|
||||
|
||||
- action: screenshot
|
||||
path: "/tmp/continue_on_error.png"
|
||||
@@ -0,0 +1,16 @@
|
||||
name: "scrape_titulo"
|
||||
steps:
|
||||
- action: navigate
|
||||
url: "https://example.com"
|
||||
|
||||
- action: wait
|
||||
selector: "h1"
|
||||
timeout_ms: 5000
|
||||
|
||||
- action: evaluate
|
||||
expr: "document.querySelector('h1').textContent"
|
||||
|
||||
- action: get_html
|
||||
|
||||
- action: screenshot
|
||||
path: "/tmp/example_com.png"
|
||||
@@ -0,0 +1,6 @@
|
||||
name: "navegar_youtube"
|
||||
steps:
|
||||
- action: navigate
|
||||
url: "https://www.youtube.com"
|
||||
- action: screenshot
|
||||
path: "/tmp/youtube.png"
|
||||
Reference in New Issue
Block a user