Add request logs

This commit is contained in:
Akim Mamedov
2023-10-18 10:54:14 +07:00
parent f4e0a23cb1
commit 3c1b422ed5
2 changed files with 6 additions and 4 deletions

View File

@ -30,8 +30,9 @@ const test = async () => {
console.log(`${message.type().toUpperCase()}: ${message.text()}`),
);
// uncomment to debug what's happening inside the browser
// page.on('console', (msg) => console.log('// from console: ', msg.text()));
page.on("requestfailed", (request) => {
console.log(`ERROR: ${request.url()} ${request.failure()?.errorText}`);
});
console.log("going to the page in browser...");
await page.goto(uri);

View File

@ -49,8 +49,9 @@ const test = async () => {
console.log(`${message.type().toUpperCase()}: ${message.text()}`);
});
// uncomment to debug what's happening inside the browser
// page.on('console', (msg) => console.log('// from console: ', msg.text()));
page.on("requestfailed", (request) => {
console.log(`ERROR: ${request.url()} ${request.failure()?.errorText}`);
});
console.log("going to the page in browser...");
await page.goto(uri);