Versions

  • v14

    6/12/2024
    Open: Version
    Changes from v13 to v14
    +2
    -6
    ⦚ 6 unchanged lines ⦚
    let table = doc.querySelector("table#cf_homepage__teamTable");

    console.log(table.innerHTML);
    /*
    // Extracting table headers
    const headers = Array.from(table.querySelectorAll("th")).map(header => header.textContent.trim());

    // Extracting table rows
    const rows = Array.from(table.querySelectorAll("tr"));

    // Extracting the data
    const tableData = rows.map(row => {
    ⦚ 13 unchanged lines ⦚
    ⦚ 6 unchanged lines ⦚
    let table = doc.querySelector("table#cf_homepage__teamTable");

    const headers = Array.from(table.querySelectorAll("th")).map(header => header.textContent.trim());
    const rows = Array.from(table.querySelectorAll("tr"));
    console.log(headers);
    /*
    // Extracting the data
    const tableData = rows.map(row => {
    ⦚ 13 unchanged lines ⦚
  • v13

    6/12/2024
    Open: Version
    Changes from v12 to v13
    +1
    -1
    ⦚ 6 unchanged lines ⦚
    let table = doc.querySelector("table#cf_homepage__teamTable");

    console.log(table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
    ⦚ 6 unchanged lines ⦚
    let table = doc.querySelector("table#cf_homepage__teamTable");

    console.log(table.innerHTML);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
  • v12

    6/12/2024
    Open: Version
    Changes from v11 to v12
    +3
    -2
    import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
    const url = "https://www.capfriendly.com/";

    let res = await fetch(url);
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table#cf_homepage__teamTable");
    console.log(table);
    /*
    ⦚ 21 unchanged lines ⦚
    import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";

    let url = "https://www.capfriendly.com/";
    let res = await fetch(url);
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    let table = doc.querySelector("table#cf_homepage__teamTable");

    console.log(table);
    /*
    ⦚ 21 unchanged lines ⦚
  • v11

    6/12/2024
    Open: Version
    Changes from v10 to v11
    +1
    -1
    ⦚ 4 unchanged lines ⦚
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_homepage__teamTable");
    console.log(table);
    /*
    ⦚ 21 unchanged lines ⦚
    ⦚ 4 unchanged lines ⦚
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table#cf_homepage__teamTable");
    console.log(table);
    /*
    ⦚ 21 unchanged lines ⦚
  • v10

    6/12/2024
    Open: Version
    Changes from v9 to v10
    +2
    -2
    ⦚ 4 unchanged lines ⦚
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log(html);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
    ⦚ 4 unchanged lines ⦚
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_homepage__teamTable");
    console.log(table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
  • v9

    6/12/2024
    Open: Version
    Changes from v8 to v9
    +1
    -1
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log("----->", table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log(html);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
  • v8

    6/12/2024
    Open: Version
    Changes from v7 to v8
    +1
    -1
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log(table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log("----->", table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
  • v7

    6/12/2024
    Open: Version
    Changes from v6 to v7
    +1
    -0
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
    ⦚ 5 unchanged lines ⦚
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    console.log(table);
    /*
    // Extracting table headers
    ⦚ 20 unchanged lines ⦚
  • v6

    6/12/2024
    Open: Version
    +29
    -0

    import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
    const url = "https://www.capfriendly.com/";

    let res = await fetch(url);
    let html = await res.text();
    let doc = new DOMParser().parseFromString(html, "text/html");
    const table = doc.querySelector("table.cf_table");
    /*
    // Extracting table headers
    const headers = Array.from(table.querySelectorAll("th")).map(header => header.textContent.trim());

    // Extracting table rows
    const rows = Array.from(table.querySelectorAll("tr"));

    // Extracting the data
    const tableData = rows.map(row => {
    const cells = Array.from(row.querySelectorAll("td"));
    const cellData = cells.map(cell => cell.textContent.trim());
    if (cellData.length > 0) {
    return Object.fromEntries(headers.map((header, index) => [header, cellData[index]]));
    }
    return null;
    }).filter(row => row !== null);

    // Converting the data to JSON format
    const jsonData = JSON.stringify(tableData, null, 4);

    // Print the JSON data
    console.log(jsonData);*/