Trying to Scrape an Array

node , cheerio , javascript United States
  • 1 month ago

    I'm trying to scrape the following:

            <td style="font-family:eurof;font-size:14px;padding-top:0px;padding-bottom:5px;"><a style="font-family:eurof;font-size:14px;" href="jewelry">JEWELRY</a>  >  <a style="font-family:eurof;font-size:14px;" href="jewelry/anklet">ANKLET</a>  >  <a style="font-family:eurof;font-size:14px;" href="jewelry/anklet/fashion">FASHION</a>  >  <a style="font-family:eurof;font-size:14px;" href="jewelry/anklet/fashion/"></a>

    I use:

    var categories = [];
    const cheerio = require("cheerio");
    const $ = await cheerio.load(content);

    The results of my console.log are:


    I want to get


  • 1 month ago

    The answer was posted here:

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If debugging is the process of removing software bugs, then programming must be the process of putting them in.” - Edsger Dijkstra