Actualizar robot.js
This commit is contained in:
12
robot.js
12
robot.js
@@ -317,10 +317,16 @@ async function runHomeserve(ownerId, user, pass, gremiosDB) {
|
|||||||
await page.waitForTimeout(5000);
|
await page.waitForTimeout(5000);
|
||||||
console.log(`👀 [HomeServe] URL tras intentar login: ${page.url()}`);
|
console.log(`👀 [HomeServe] URL tras intentar login: ${page.url()}`);
|
||||||
|
|
||||||
// FOTO ESPÍA: Si la URL sigue siendo la del login, hacemos una captura
|
// 🚨 EL LECTOR DE PANTALLA: Si se queda en el login, leemos qué dice el error
|
||||||
if (page.url().includes('PROF_PASS')) {
|
if (page.url().includes('PROF_PASS')) {
|
||||||
console.log("📸 [HomeServe] El login falló. Guardando captura de pantalla como 'error_homeserve.png'...");
|
console.log("⚠️ [HomeServe] El login falló. Leyendo el texto visible de la web...");
|
||||||
await page.screenshot({ path: 'error_homeserve.png' });
|
const textoPantalla = await page.evaluate(() => {
|
||||||
|
return document.body.innerText.replace(/\n+/g, '\n').trim();
|
||||||
|
});
|
||||||
|
console.log("\n🚨 ESTO ES LO QUE ESTÁ VIENDO EL ROBOT EN LA PANTALLA:");
|
||||||
|
console.log("--------------------------------------------------");
|
||||||
|
console.log(textoPantalla.substring(0, 800));
|
||||||
|
console.log("--------------------------------------------------\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("⚠️ [HomeServe] NO se detectó el formulario de login.");
|
console.log("⚠️ [HomeServe] NO se detectó el formulario de login.");
|
||||||
|
|||||||
Reference in New Issue
Block a user