import * as cheerio from "cheerio"; import * as fs from "fs"; const file = process.argv[2]; const html = fs.readFileSync(file, "utf8"); const $ = cheerio.load(html); $("a").each((i, el) => { const text = $(el).text().trim(); const label = $(el).attr("aria-label"); if (!text && !label) { console.log(`Empty anchor found: ${$(el).toString()}`); } });