Skip to content
Snippets Groups Projects
Commit afb31b86 authored by Brian Peiris's avatar Brian Peiris
Browse files

improve bot logging

parent aa565742
No related branches found
No related tags found
No related merge requests found
...@@ -18,17 +18,17 @@ const querystring = require("query-string"); ...@@ -18,17 +18,17 @@ const querystring = require("query-string");
(async () => { (async () => {
const browser = await puppeteer.launch({ ignoreHTTPSErrors: true }); const browser = await puppeteer.launch({ ignoreHTTPSErrors: true });
const page = await browser.newPage(); const page = await browser.newPage();
page.on("console", msg => console.log("PAGE: ", msg.text()));
page.on("error", err => console.error("ERROR: ", err));
page.on("pageerror", err => console.error("PAGE ERROR: ", err));
const params = { const params = {
room: options["--room"], room: options["--room"],
bot: true bot: true
}; };
console.log(params); console.log(params);
const url = `https://${options["--host"]}/hub.html?${querystring.stringify(params)}`; const url = `https://${options["--host"]}/hub.html?${querystring.stringify(params)}`;
console.log("Spawning bot...");
page.on("console", msg => console.log("PAGE: ", msg.text()));
const navigate = async () => { const navigate = async () => {
try { try {
await page.goto(url); await page.goto(url);
...@@ -46,5 +46,7 @@ const querystring = require("query-string"); ...@@ -46,5 +46,7 @@ const querystring = require("query-string");
setTimeout(navigate, 1000); setTimeout(navigate, 1000);
} }
}; };
console.log("Spawning bot...");
navigate(); navigate();
})(); })();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment