cheerio

Fast, flexible, and lean implementation of core jQuery designed specifically for the server. (by cheeriojs)

Cheerio Alternatives

Similar projects and alternatives to cheerio

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better cheerio alternative or higher similarity.

Suggest an alternative to cheerio

cheerio reviews and mentions

Posts with mentions or reviews of cheerio. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-05-13.
  • Show HN: A Full-Stack Web Framework Written in Go
    18 projects | news.ycombinator.com | 13 May 2022
    Sure, it's actually been a long journey since PHP.

    I switched from PHP to Node about 11 years ago. I was probably one of the first 100 Node.js developers. My biggest contribution there was creating https://github.com/cheeriojs/cheerio.

    Go spoils me because it "just works". The best way I can explain it is when I'm stuck on something in Go, it's almost always my bad, not something that Go is doing poorly. This is in contrast to the Node.js ecosystem where it feels like half of the problems I run into shouldn't be my responsibility.

    I relate a lot to this post by @kburke: https://kevin.burke.dev/kevin/one-year-of-node-js/

    My transition from Node.js to Go happened because I was working solo on https://standupjack.com/ and I kept running into issues with the message broker. It was using the most popular RabbitMQ library for Node.js, yet was still super flaky.

    About 6 years ago, I was chatting with TJ Holowaychuk and he kept singing Go's praises. One holiday I decided to rewrite the message broker in Go. I got it into production in 3 days and didn't have anymore problems with it. That set me on the Go journey :)

  • The "mangabank.org" has disappeared.
    4 projects | dev.to | 9 May 2022
  • 11 JavaScript Examples to Source Code That Reveal Design Patterns In Use
    13 projects | dev.to | 20 Mar 2022
    cheerio is a library I still use today that was heavily inspired by the jQuery library, and remains popular today when topics like web scraping come up. It uses chaining to manipulate DOM nodes similarly to jQuery.
  • How to fetch meta tags of a page using its URL?
    2 projects | reddit.com/r/webdev | 4 Mar 2022
    If you want to implement it yourself then you'll have to fetch the URL on your backend, parse the HTML meta tags and extract the information from it using a library like cheerio.
  • I have a project that I feel like would be fairly simple, but I'm not an expert by any means. Someone help?
    1 project | reddit.com/r/AskProgramming | 26 Feb 2022
    Node.js with Cheerio
  • My Daily Reads - Tailored dev content delivered to your inbox.
    7 projects | dev.to | 13 Jan 2022
    Content analyzed with the assistance of cheerio.
  • I built a Space industry job board with Next.js!
    2 projects | reddit.com/r/javascript | 4 Dec 2021
    To create the web scraper I am using puppeteer https://github.com/puppeteer/puppeteer and cheerio https://github.com/cheeriojs/cheerio
  • Automating email verification for online accounts using JavaScript
    6 projects | dev.to | 29 Nov 2021
    cheerio to parse the HTML structure of an incoming email and filter out the link we need to click to verify our email address by an attribute (in this case the text Content of the link but it could be any html attribute)
  • In-lining Styles Client Side
    7 projects | dev.to | 11 Nov 2021
    And it in-lines tagged HTML wonderfully. Works well.

    Still, it's overkill, brings with it dependencies cheerio, mensch and slick and a look into the code behind the on-line demo makes rapidly clear that Juice is parsing the style sheets and applying them in what looks to be, must be, a product of its age. It has over 1500 lines of Javascript and the repo was created in 2011 - the state of Javascript was woeful then compared with today (though not as woeful as in 2001 😏).

    So we have to give Juice full credit and admiration for its age and endurance, and that it's still being maintained and is useful. But I'll respectfully pass it by as I'm looking for a minimalist, native Javascript solution as far as possible, using the state of Javascript in 2021 a whole decade later (which in IT terms is an eon).

    inline-css 👎

    Immediately disconcerting is the npm documentation for this package. It says simply "Inspired by juice" and fails to tell us why the authors felt that embarking on a new project was worth their while. It hints at the fact that it's better than Juice in some way or other (why else start a new project inspired by it?), but lays no claim as to if or how that might be the case. A dark horse.

    The github repo dates to 2015 and so, it's not as long-in-the-tooth as Juice, but still, it likely leans on a more meager JavaScript standard than we have available today and quite possibly, like Juice resorts to parsing CSS code and interpreting it. It has about 1700 lines of Javascript and so is even larger than Juice! The last code contributions on github are early 2020 so at least it's being maintained which is good.

    Still, it also depends on cheerio, and so falls a little short of a native solution but worse, it does not provide us with any suggestion as to run-context (server side or client side).

    It's on npm, which is Node.js which suggests server-side JavaScript. It doesn't rule out that it works client-side, but there is zero indication provided that it does nor a test site, the way Juice provided. And like it or not, I associate npm primarily with Node.js and server side applications (rightly or wrongly).

    So for my needs, it goes respectfully into the too-hard basket. Failed, in a sense, by the poor quality of its own introductory presentation. An irony, because there is some nice documentation there, just not a nice introduction that spells out whether it runs client-side or not, how to if so, and how it's different from Juice and why we'd use it. All the obvious questions I have surfing in on it.

    css-inliner 👎

    Long story short, the introductory documentation fails this package even more than that for inline-css did. Again, it's on npm, and so looks targeted at server-side use and makes no effort to mention the other two (Juice or inline-css), or differentiate itself from them. The github repo dates back to 2015 as well and so it looks at some level to be an example of modern parallel development, this and inline-css emerging at the same time. And unsurprisingly, it again has around 1600 lines of JavaScript. The last code contribution was 2020 so again, at least it's being maintained which is good I guess.

    Still, no hint as to the run-context it supports (server-side and/or client-side) but hints, via its npm references and templating languages that it's a server-side tool not a client-side tool. Which doesn't rule out client-side application but again no claim that it works in that context, and no tips on how (if it does) and no demo site, so it's a respectful pass. Still seeking a lean native Javascript solution in preference to some pet project lacking clarity and exhibiting bloat.

    Native Javascript 👍

    The failure to find an existing solution, leads me to (seeking) a native JavaScript implementation and the journey of discovery that lies behind that.

    document.styleSheets provides us with a collection of CSSStyleSheets and CSSStyleSheet.rules in turn provides all of the CSSStyleRules in use and Element.matches() tells us if CSSStyleRule.selectorText applies to a given element.

    window.getComputedStyle() provides rapid access to the complete set of computed styles. That is, crucially it has taken all those styles that position things relative to the browser window and calculated where, in real coordinates it landed. Among other things. Crucially, it also has resolved all of CSS variables. It describes what an element actually looks like on the screen, rather than in the abstract CSS.

    We can use the style sheets and the computed styles to update the style attribute of each element and then, when all is done the innerText and the innerHTML or outerHTML are available for the the text/plain and text/html MIME parts respectively.

    Given we're in-lining styles, and we don't want to actually change the element in the DOM (we're just aiming to copy it to the clipboard in one form or another), we have to take a copy of the DOM element and in-line the styles on that. We have to use the computed style from the source element however as it is rendered on screen and the copy is not (hence has not got computed styles). To wit, we will have a source and target element one that is in the DOM and provides computed styles, and one that is not in the DOM and receives in-lined style attributes.

    Importantly an implementation like this is maybe 200, or 300 lines of JavaScript and not 1500.

    That more or less covers us and we have a terse native JavaScript in-lining solution!

    But ... performance, performance ... turns out that it's not slow, but it's not fast either, let's take a look at performance next, before we dive into an actual code implementation of the above schema - next week's article.

  • I built a job board for the Space industry! link in comments
    2 projects | reddit.com/r/webdev | 9 Oct 2021
    - Web scraper: Cheerio and Puppeteer
  • What is the best language to use if I want to scan a webpage for certain keywords?
    1 project | reddit.com/r/AskProgramming | 22 Sep 2021
    I used https://cheerio.js.org/ in the past. It's awesome. You tell it what Dom elements to get. Can do all sorts of web scraping stuff. So easy to use too...
  • What is the best option to parse a RSS podcast feed (XML) with Nuxt.Js?
    2 projects | reddit.com/r/Nuxt | 21 Sep 2021
  • Web Scraping with Javascript and Node.js
    5 projects | dev.to | 1 Sep 2021
    Cheerio is a "fast, flexible & lean implementation of core jQuery." It lets us find nodes with selectors, get text or attributes, and many other things. We will pass the HTML to cheerio and then query it as we would in a browser environment.
  • How to Scrape Google SERPs Using WebScrapingAPI in Node.js
    2 projects | dev.to | 1 Sep 2021
    In the following section, we will use Node.js and some libraries like got and Cheerio to create the script that will get all the data from a SERP and format it nicely to be as understandable as possible.
  • Create An IMDB Web Scraper Using JS
    1 project | dev.to | 22 Aug 2021
    cheerio helps us to parse HTML in nodeJS. It's an affective and powerful technology used in webscraping in sever side implementation. The FS module should be pre-installed in the node_modules if you previously used npm init command.

Stats

Basic cheerio repo stats
25
25,068
9.7
7 days ago

cheeriojs/cheerio is an open source project licensed under MIT License which is an OSI approved license.

Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
scoutapm.com
Find remote TypeScript jobs at our new job board 99remotejobs.com. There are 2 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.