// Lặp qua từng hàng và lấy nội dung của các cột (thẻ | ) trong hàng
      const data = [];
      rows.forEach((row) => {
        const columns = Array.from(row.querySelectorAll("td")); // Lựa chọn tất cả các cột (thẻ  | ) trong hàng
        const rowData = columns.map((column) => column.textContent.trim()); // Lấy nội dung của các cột và xóa khoảng trắng
        data.push(rowData); // Thêm dữ liệu của hàng vào mảng data
      });
      return data.map((u) => u.join("\n\n"));
    });
    console.log("Table data:", tableData);
    await browser.close();
    let params = {
      type: "stream",
      to: "networkToolBot",
      topic: "powerSchedule",
      content:
        ":warning: :date: :warning:\n\n" + tableData.join("\n\n") + "\n-------",
    };
    client.messages.send(params);
    if (
      tableData.filter((i) => i.includes("KDC 91B") || i.includes("KDC91B"))
        .length > 0
    ) {
      let params = {
        type: "stream",
        to: "APAC Tech Bão",
        topic: "Thông báo chung",
        content:
          ":warning: :date: :warning:\n\n" +
          tableData
            .filter((i) => i.includes("KDC 91B") || i.includes("KDC91B"))[0]
            .replace(/KDC 91B/g, "**KDC 91B**") +
          "\n-------",
      };
      client.messages.send(params);
    }
    const fileName =
      "/home/Log_service/app/store/logsAPI/" +
      moment(Date.now()).format("DD_MM_YYYY").toString() +
      ".log";
  addLogFunction(fileName, JSON.stringify(params, null, 2), "powerSchedule")
  }, 5000);
  
})();
 |