{"id":64,"date":"2026-10-23T22:51:06","date_gmt":"2026-10-23T14:51:06","guid":{"rendered":"https:\/\/glossary.clawoxy.com\/?p=64"},"modified":"2026-10-23T22:51:33","modified_gmt":"2026-10-23T14:51:33","slug":"cheerio","status":"publish","type":"post","link":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/","title":{"rendered":"cheerio"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API. Give it markup, then use familiar selectors such as <code>$('h1')<\/code> or <code>$('.price')<\/code> to read or traverse elements. It is a parser, not a browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A Small Example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>import * as cheerio from 'cheerio';\n\nconst $ = cheerio.load('&lt;h1 class=\"title\"&gt;Books&lt;\/h1&gt;');\nconst title = $('.title').text();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>$<\/code> function searches the parsed document. Cheerio does not fetch the HTML for you in every setup; commonly, a separate HTTP client gets the response and passes its body to <code>cheerio.load()<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Cheerio Is a Good Fit<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It works well when the response already contains the content you need and CSS selectors are a convenient way to extract it. It is lighter than launching a full browser for every page. If a site inserts the target content with JavaScript, Cheerio will not run those scripts; inspect the received HTML first, then use a browser-based tool only if rendering is actually required.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One easy trap: an empty selection often returns an empty string rather than throwing an error. Check the number of matches before assuming your selector found the right field. Also trim or normalize whitespace yourself when the source markup contains line breaks and indentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/cheerio.js.org\/docs\/basics\/selecting\/\">Cheerio: Selecting elements<\/a><\/li>\n<li><a href=\"https:\/\/cheerio.js.org\/docs\/basics\/troubleshooting\/\">Cheerio: Troubleshooting<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API. Give it markup, then use familiar selectors such as $(&#8216;h1&#8217;) or $(&#8216;.price&#8217;) to read or traverse elements. It is a parser, not a browser. A Small Example The $ function searches the parsed document. Cheerio does not fetch the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-glossary"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>cheerio - glossary<\/title>\n<meta name=\"description\" content=\"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.clawoxy.com\/glossary\/cheerio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"cheerio - glossary\" \/>\n<meta property=\"og:description\" content=\"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.clawoxy.com\/glossary\/cheerio\/\" \/>\n<meta property=\"og:site_name\" content=\"glossary\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-23T14:51:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-23T14:51:33+00:00\" \/>\n<meta name=\"author\" content=\"Victoria\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Victoria\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/\"},\"author\":{\"name\":\"Victoria\",\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#\\\/schema\\\/person\\\/f2cd3fd0bdf481ab8a9d402da0fdeb5c\"},\"headline\":\"cheerio\",\"datePublished\":\"2026-10-23T14:51:06+00:00\",\"dateModified\":\"2026-10-23T14:51:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/\"},\"wordCount\":193,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#organization\"},\"articleSection\":[\"Glossary\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/\",\"url\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/\",\"name\":\"cheerio - glossary\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#website\"},\"datePublished\":\"2026-10-23T14:51:06+00:00\",\"dateModified\":\"2026-10-23T14:51:33+00:00\",\"description\":\"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/cheerio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/47.84.23.125:443\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"cheerio\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#website\",\"url\":\"https:\\\/\\\/47.84.23.125:443\\\/\",\"name\":\"clawoxy glossary\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/47.84.23.125:443\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#organization\",\"name\":\"clawoxy\",\"url\":\"https:\\\/\\\/47.84.23.125:443\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/47.84.23.125:443\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/logo_light_600.png\",\"contentUrl\":\"https:\\\/\\\/47.84.23.125:443\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/logo_light_600.png\",\"width\":600,\"height\":145,\"caption\":\"clawoxy\"},\"image\":{\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/47.84.23.125:443\\\/#\\\/schema\\\/person\\\/f2cd3fd0bdf481ab8a9d402da0fdeb5c\",\"name\":\"Victoria\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g\",\"caption\":\"Victoria\"},\"url\":\"https:\\\/\\\/www.clawoxy.com\\\/glossary\\\/author\\\/victoria\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"cheerio - glossary","description":"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/","og_locale":"en_US","og_type":"article","og_title":"cheerio - glossary","og_description":"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.","og_url":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/","og_site_name":"glossary","article_published_time":"2026-10-23T14:51:06+00:00","article_modified_time":"2026-10-23T14:51:33+00:00","author":"Victoria","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Victoria"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/#article","isPartOf":{"@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/"},"author":{"name":"Victoria","@id":"https:\/\/47.84.23.125:443\/#\/schema\/person\/f2cd3fd0bdf481ab8a9d402da0fdeb5c"},"headline":"cheerio","datePublished":"2026-10-23T14:51:06+00:00","dateModified":"2026-10-23T14:51:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/"},"wordCount":193,"commentCount":0,"publisher":{"@id":"https:\/\/47.84.23.125:443\/#organization"},"articleSection":["Glossary"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.clawoxy.com\/glossary\/cheerio\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/","url":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/","name":"cheerio - glossary","isPartOf":{"@id":"https:\/\/47.84.23.125:443\/#website"},"datePublished":"2026-10-23T14:51:06+00:00","dateModified":"2026-10-23T14:51:33+00:00","description":"Cheerio is a Node.js library for loading and querying HTML or XML with a jQuery-like API.","breadcrumb":{"@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.clawoxy.com\/glossary\/cheerio\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.clawoxy.com\/glossary\/cheerio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/47.84.23.125:443\/"},{"@type":"ListItem","position":2,"name":"cheerio"}]},{"@type":"WebSite","@id":"https:\/\/47.84.23.125:443\/#website","url":"https:\/\/47.84.23.125:443\/","name":"clawoxy glossary","description":"","publisher":{"@id":"https:\/\/47.84.23.125:443\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/47.84.23.125:443\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/47.84.23.125:443\/#organization","name":"clawoxy","url":"https:\/\/47.84.23.125:443\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/47.84.23.125:443\/#\/schema\/logo\/image\/","url":"https:\/\/47.84.23.125:443\/wp-content\/uploads\/2026\/10\/logo_light_600.png","contentUrl":"https:\/\/47.84.23.125:443\/wp-content\/uploads\/2026\/10\/logo_light_600.png","width":600,"height":145,"caption":"clawoxy"},"image":{"@id":"https:\/\/47.84.23.125:443\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/47.84.23.125:443\/#\/schema\/person\/f2cd3fd0bdf481ab8a9d402da0fdeb5c","name":"Victoria","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/58bdb169212e5e6416fff3eb32931f742da3e068cf0b5e5b8b484c54bf773c77?s=96&d=mm&r=g","caption":"Victoria"},"url":"https:\/\/www.clawoxy.com\/glossary\/author\/victoria\/"}]}},"_links":{"self":[{"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":1,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/posts\/64\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.clawoxy.com\/glossary\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}