Skip to content

Instantly share code, notes, and snippets.

@mykolaharmash
Last active November 11, 2019 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykolaharmash/ebdd656387ccb517cc9125af003a56fb to your computer and use it in GitHub Desktop.
Save mykolaharmash/ebdd656387ccb517cc9125af003a56fb to your computer and use it in GitHub Desktop.
Collect all the links within HTML string and report performance (cheerio, jsdom, hyntax)
const fs = require('fs')
const { PerformanceObserver, performance } = require('perf_hooks');
const cheerio = require('cheerio')
const { JSDOM } = require("jsdom")
const { tokenize, constructTree } = require('hyntax')
const html = fs.readFileSync('./github.html').toString()
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries())
performance.clearMarks()
})
obs.observe({ entryTypes: ['measure'] })
// Cheerio
performance.mark('cheerio-start')
const $ = cheerio.load(html)
$('a')
performance.mark('cheerio-end')
performance.measure('cheerio', 'cheerio-start', 'cheerio-end')
// jsdom
performance.mark('jsdom-start')
const dom = new JSDOM(html);
dom.window.document.querySelectorAll('a')
performance.mark('jsdom-end')
performance.measure('jsdom', 'jsdom-start', 'jsdom-end')
// Hyntax
function visitChildren(children = [], visitFn) {
return children.flatMap(visitFn)
}
function collectNodes(node, evaluator) {
const links = visitChildren(node.content.children, node => collectNodes(node, evaluator))
if (evaluator(node)) {
links.push(node)
}
return links
}
function isLink(node) {
return node.nodeType === 'tag' && node.content.name === 'a'
}
performance.mark('hyntax-start')
const { tokens } = tokenize(html)
const { ast } = constructTree(tokens)
collectNodes(ast, isLink)
performance.mark('hyntax-end')
performance.measure('hyntax', 'hyntax-start', 'hyntax-end')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://github.githubassets.com">
<link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
<link crossorigin="anonymous" media="all" integrity="sha512-/YEVWs7BzxfKyUd6zVxjEQcXRWsLbcEjv045Rq8DSoipySmQblhVKxlXLva2GtNd5DhwCxHwW1RM0N9I7S2Vew==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-481a47a96965f6706fb41bae0d14b09a.css" />
<link crossorigin="anonymous" media="all" integrity="sha512-rqlwdaP+8oV7JwHySo0RpslRQAvrs57OQxH/1vmIliL2vqPijry+bYuYzVw9yZoZMZI0Lbe3tJeMlcDPvISBUg==" rel="stylesheet" href="https://github.githubassets.com/assets/site-3433075f8dfd606217b813c84aaed516.css" />
<link crossorigin="anonymous" media="all" integrity="sha512-UuDKgNf/5qyjHC2IFg8kEkn3j2n+D4ShuvNV5eohEqUPfuPzqAxcd98IqomrgGo/g36tB35YvxoA1CbXgE0iFg==" rel="stylesheet" href="https://github.githubassets.com/assets/github-5362384f9e2512870c388a187eaf4868.css" />
<meta name="viewport" content="width=device-width">
<title>GitHub - cheeriojs/cheerio: Fast, flexible, and lean implementation of core jQuery designed specifically for the server.</title>
<meta name="description" content="Fast, flexible, and lean implementation of core jQuery designed specifically for the server. - cheeriojs/cheerio">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
<meta name="twitter:image:src" content="https://avatars2.githubusercontent.com/u/7230330?s=400&amp;v=4" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary" /><meta name="twitter:title" content="cheeriojs/cheerio" /><meta name="twitter:description" content="Fast, flexible, and lean implementation of core jQuery designed specifically for the server. - cheeriojs/cheerio" />
<meta property="og:image" content="https://avatars2.githubusercontent.com/u/7230330?s=400&amp;v=4" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="cheeriojs/cheerio" /><meta property="og:url" content="https://github.com/cheeriojs/cheerio" /><meta property="og:description" content="Fast, flexible, and lean implementation of core jQuery designed specifically for the server. - cheeriojs/cheerio" />
<link rel="assets" href="https://github.githubassets.com/">
<meta name="request-id" content="80F4:2D001:1110A2A:1A19495:5DC924C0" data-pjax-transient>
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
<meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc">
<meta name="octolytics-host" content="collector.githubapp.com" /><meta name="octolytics-app-id" content="github" /><meta name="octolytics-event-url" content="https://collector.githubapp.com/github-external/browser_event" /><meta name="octolytics-dimension-request_id" content="80F4:2D001:1110A2A:1A19495:5DC924C0" /><meta name="octolytics-dimension-region_edge" content="ams" /><meta name="octolytics-dimension-region_render" content="iad" /><meta name="octolytics-dimension-ga_id" content="" class="js-octo-ga-id" /><meta name="octolytics-dimension-visitor_id" content="2499813814162760896" />
<meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;" data-pjax-transient="true" />
<meta name="google-analytics" content="UA-3769691-2">
<meta class="js-ga-set" name="dimension1" content="Logged Out">
<meta name="hostname" content="github.com">
<meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="js-proxy-site-detection-payload" content="ZmNhOGMyNjI3MmMzNzJhZWU4ZGZjYmQwM2UwNjA5OTRhYmI2M2Q4YTY1OWI0ODFhNGMxZGU2MzFlOWM5MGZiMnx7InJlbW90ZV9hZGRyZXNzIjoiMTMxLjIyOC4yMTYuMTMxIiwicmVxdWVzdF9pZCI6IjgwRjQ6MkQwMDE6MTExMEEyQToxQTE5NDk1OjVEQzkyNEMwIiwidGltZXN0YW1wIjoxNTczNDYzMjMyLCJob3N0IjoiZ2l0aHViLmNvbSJ9">
<meta name="enabled-features" content="ACTIONS_V2_ON_MARKETPLACE,MARKETPLACE_FEATURED_BLOG_POSTS,MARKETPLACE_INVOICED_BILLING,MARKETPLACE_SOCIAL_PROOF_CUSTOMERS,MARKETPLACE_TRENDING_SOCIAL_PROOF,MARKETPLACE_RECOMMENDATIONS,MARKETPLACE_PENDING_INSTALLATIONS">
<meta name="html-safe-nonce" content="3ad6484036123df02933fc03290acafa35fd5b01">
<meta http-equiv="x-pjax-version" content="fa69a6766b45881d74d00fb909806b32">
<link href="https://github.com/cheeriojs/cheerio/commits/v1.0.0.atom" rel="alternate" title="Recent Commits to cheerio:v1.0.0" type="application/atom+xml">
<meta name="go-import" content="github.com/cheeriojs/cheerio git https://github.com/cheeriojs/cheerio.git">
<meta name="octolytics-dimension-user_id" content="7230330" /><meta name="octolytics-dimension-user_login" content="cheeriojs" /><meta name="octolytics-dimension-repository_id" content="2541284" /><meta name="octolytics-dimension-repository_nwo" content="cheeriojs/cheerio" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="2541284" /><meta name="octolytics-dimension-repository_network_root_nwo" content="cheeriojs/cheerio" /><meta name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" content="false" />
<link rel="canonical" href="https://github.com/cheeriojs/cheerio" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://github.githubassets.com/favicon.ico">
<meta name="theme-color" content="#1e2327">
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production min-width-lg">
<div class="position-relative js-header-wrapper ">
<a href="#start-of-content" tabindex="1" class="px-2 py-4 bg-blue text-white show-on-focus js-skip-to-content">Skip to content</a>
<span class="Progress progress-pjax-loader position-fixed width-full js-pjax-loader-bar">
<span class="progress-pjax-loader-bar top-0 left-0" style="width: 0%;"></span>
</span>
<header class="Header-old header-logged-out position-relative f4 py-2" role="banner">
<div class="container-lg d-flex px-3">
<div class="d-flex flex-justify-between flex-items-center">
<a class="mr-4" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
<svg height="32" class="octicon octicon-mark-github text-white" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
</div>
<div class="HeaderMenu HeaderMenu--logged-out d-flex flex-justify-between flex-items-center flex-auto">
<div class="d-none">
<button class="btn-link js-details-target" type="button" aria-label="Toggle navigation" aria-expanded="false">
<svg height="24" class="octicon octicon-x text-gray" viewBox="0 0 12 16" version="1.1" width="18" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>
</button>
</div>
<nav class="mt-0" aria-label="Global">
<ul class="d-flex list-style-none">
<li class=" mr-3 mr-lg-3 edge-item-fix position-relative flex-wrap flex-justify-between d-flex flex-items-center ">
<details class="HeaderMenu-details details-overlay details-reset width-full">
<summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-inline-block">
Why GitHub?
<svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-relative">
<path d="M1,1l6.2,6L13,1"></path>
</svg>
</summary>
<div class="dropdown-menu flex-auto rounded-1 bg-white px-0 mt-0 p-4 left-n4 position-absolute">
<a href="/features" class="py-2 lh-condensed-ultra d-block link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Features">Features <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a>
<ul class="list-style-none f5 pb-3">
<li class="edge-item-fix"><a href="/features/code-review/" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Code review">Code review</a></li>
<li class="edge-item-fix"><a href="/features/project-management/" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Project management">Project management</a></li>
<li class="edge-item-fix"><a href="/features/integrations" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Integrations">Integrations</a></li>
<li class="edge-item-fix"><a href="/features/actions" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Actions">Actions</a></li>
<li class="edge-item-fix"><a href="/features/package-registry" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Package Registry">Package registry</a></li>
<li class="edge-item-fix"><a href="/features/security" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Security">Security</a></li>
<li class="edge-item-fix"><a href="/features#team-management" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Team management">Team management</a></li>
<li class="edge-item-fix"><a href="/features#social-coding" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Social coding">Social coding</a></li>
<li class="edge-item-fix"><a href="/features#documentation" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Documentation">Documentation</a></li>
<li class="edge-item-fix"><a href="/features#code-hosting" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Code hosting">Code hosting</a></li>
</ul>
<ul class="list-style-none mb-0 border-lg-top pt-lg-3">
<li class="edge-item-fix"><a href="/customer-stories" class="py-2 lh-condensed-ultra d-block no-underline link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Customer stories">Customer stories <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a></li>
<li class="edge-item-fix"><a href="/security" class="py-2 lh-condensed-ultra d-block no-underline link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Security">Security <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a></li>
</ul>
</div>
</details>
</li>
<li class=" mr-3 mr-lg-3">
<a href="/enterprise" class="HeaderMenu-link no-underline py-3 d-block d-lg-inline-block" data-ga-click="(Logged out) Header, go to Enterprise">Enterprise</a>
</li>
<li class=" mr-3 mr-lg-3 edge-item-fix position-relative flex-wrap flex-justify-between d-flex flex-items-center ">
<details class="HeaderMenu-details details-overlay details-reset width-full">
<summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-inline-block">
Explore
<svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-relative">
<path d="M1,1l6.2,6L13,1"></path>
</svg>
</summary>
<div class="dropdown-menu flex-auto rounded-1 bg-white px-0 pt-2 pb-0 mt-0 p-4 left-n4 position-absolute">
<ul class="list-style-none mb-3">
<li class="edge-item-fix"><a href="/explore" class="py-2 lh-condensed-ultra d-block link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Explore">Explore GitHub <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a></li>
</ul>
<h4 class="text-gray-light text-normal text-mono f5 mb-2 border-top pt-3">Learn &amp; contribute</h4>
<ul class="list-style-none mb-3">
<li class="edge-item-fix"><a href="/topics" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Topics">Topics</a></li>
<li class="edge-item-fix"><a href="/collections" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Collections">Collections</a></li>
<li class="edge-item-fix"><a href="/trending" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Trending">Trending</a></li>
<li class="edge-item-fix"><a href="https://lab.github.com/" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Learning lab">Learning Lab</a></li>
<li class="edge-item-fix"><a href="https://opensource.guide" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Open source guides">Open source guides</a></li>
</ul>
<h4 class="text-gray-light text-normal text-mono f5 mb-2 border-top pt-3">Connect with others</h4>
<ul class="list-style-none mb-0">
<li class="edge-item-fix"><a href="https://github.com/events" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Events">Events</a></li>
<li class="edge-item-fix"><a href="https://github.community" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Community forum">Community forum</a></li>
<li class="edge-item-fix"><a href="https://education.github.com" class="py-2 pb-0 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to GitHub Education">GitHub Education</a></li>
</ul>
</div>
</details>
</li>
<li class=" mr-3 mr-lg-3">
<a href="/marketplace" class="HeaderMenu-link no-underline py-3 d-block d-lg-inline-block" data-ga-click="(Logged out) Header, go to Marketplace">Marketplace</a>
</li>
<li class=" mr-3 mr-lg-3 edge-item-fix position-relative flex-wrap flex-justify-between d-flex flex-items-center ">
<details class="HeaderMenu-details details-overlay details-reset width-full">
<summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-inline-block">
Pricing
<svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-relative">
<path d="M1,1l6.2,6L13,1"></path>
</svg>
</summary>
<div class="dropdown-menu flex-auto rounded-1 bg-white px-0 pt-2 pb-4 mt-0 p-4 left-n4 position-absolute">
<a href="/pricing" class="pb-2 lh-condensed-ultra d-block link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Pricing">Plans <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a>
<ul class="list-style-none mb-3">
<li class="edge-item-fix"><a href="/pricing#feature-comparison" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Compare plans">Compare plans</a></li>
<li class="edge-item-fix"><a href="https://enterprise.github.com/contact" class="py-2 lh-condensed-ultra d-block link-gray no-underline f5" data-ga-click="(Logged out) Header, go to Contact Sales">Contact Sales</a></li>
</ul>
<ul class="list-style-none mb-0 border-top pt-3">
<li class="edge-item-fix"><a href="/nonprofit" class="py-2 lh-condensed-ultra d-block no-underline link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Nonprofits">Nonprofit <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a></li>
<li class="edge-item-fix"><a href="https://education.github.com" class="py-2 pb-0 lh-condensed-ultra d-block no-underline link-gray-dark no-underline h5 Bump-link--hover" data-ga-click="(Logged out) Header, go to Education">Education <span class="Bump-link-symbol float-right text-normal text-gray-light">&rarr;</span></a></li>
</ul>
</div>
</details>
</li>
</ul>
</nav>
<div class="d-flex flex-items-center px-0 text-center text-left">
<div class="d-lg-flex ">
<div class="header-search mr-3 scoped-search site-scoped-search js-site-search position-relative js-jump-to"
role="combobox"
aria-owns="jump-to-results"
aria-label="Search or jump to"
aria-haspopup="listbox"
aria-expanded="false"
>
<div class="position-relative">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="2541284" data-scoped-search-url="/cheeriojs/cheerio/search" data-unscoped-search-url="/search" action="/cheeriojs/cheerio/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
<label class="form-control input-sm header-search-wrapper p-0 header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center js-chromeless-input-container">
<input type="text"
class="form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable"
data-hotkey="s,/"
name="q"
value=""
placeholder="Search"
data-unscoped-placeholder="Search GitHub"
data-scoped-placeholder="Search"
autocapitalize="off"
aria-autocomplete="list"
aria-controls="jump-to-results"
aria-label="Search"
data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations#csrf-token=MCCsubYxLI2XrM2PSMR5h4xKUa5FwqUOGv0aNsLh3v0bjKu52W9cTpSFFPD55o9wVIpn76g5ivEOutF4dyvMzg=="
spellcheck="false"
autocomplete="off"
>
<input type="hidden" class="js-site-search-type-field" name="type" >
<img src="https://github.githubassets.com/images/search-key-slash.svg" alt="" class="mr-2 header-search-key-slash">
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<ul class="d-none js-jump-to-suggestions-template-container">
<li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-suggestion" role="option">
<a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none">
<svg height="16" width="16" class="octicon octicon-repo flex-shrink-0 js-jump-to-octicon-repo d-none" title="Repository" aria-label="Repository" viewBox="0 0 12 16" version="1.1" role="img"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
<svg height="16" width="16" class="octicon octicon-project flex-shrink-0 js-jump-to-octicon-project d-none" title="Project" aria-label="Project" viewBox="0 0 15 16" version="1.1" role="img"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 00-1 1v14a1 1 0 001 1h13a1 1 0 001-1V1a1 1 0 00-1-1z"/></svg>
<svg height="16" width="16" class="octicon octicon-search flex-shrink-0 js-jump-to-octicon-search d-none" title="Search" aria-label="Search" viewBox="0 0 16 16" version="1.1" role="img"><path fill-rule="evenodd" d="M15.7 13.3l-3.81-3.83A5.93 5.93 0 0013 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 000-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"/></svg>
</div>
<img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="" width="28" height="28">
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target">
</div>
<div class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none js-jump-to-badge-search">
<span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository">
In this repository
</span>
<span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub">
All GitHub
</span>
<span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump">
Jump to
<span class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
</a>
</li>
</ul>
<ul class="d-none js-jump-to-no-results-template-container">
<li class="d-flex flex-justify-center flex-items-center f5 d-none js-jump-to-suggestion p-2">
<span class="text-gray">No suggested jump to results</span>
</li>
</ul>
<ul id="jump-to-results" role="listbox" class="p-0 m-0 js-navigation-container jump-to-suggestions-results-container js-jump-to-suggestions-results-container">
<li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-scoped-search d-none" role="option">
<a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none">
<svg height="16" width="16" class="octicon octicon-repo flex-shrink-0 js-jump-to-octicon-repo d-none" title="Repository" aria-label="Repository" viewBox="0 0 12 16" version="1.1" role="img"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
<svg height="16" width="16" class="octicon octicon-project flex-shrink-0 js-jump-to-octicon-project d-none" title="Project" aria-label="Project" viewBox="0 0 15 16" version="1.1" role="img"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 00-1 1v14a1 1 0 001 1h13a1 1 0 001-1V1a1 1 0 00-1-1z"/></svg>
<svg height="16" width="16" class="octicon octicon-search flex-shrink-0 js-jump-to-octicon-search d-none" title="Search" aria-label="Search" viewBox="0 0 16 16" version="1.1" role="img"><path fill-rule="evenodd" d="M15.7 13.3l-3.81-3.83A5.93 5.93 0 0013 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 000-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"/></svg>
</div>
<img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="" width="28" height="28">
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target">
</div>
<div class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none js-jump-to-badge-search">
<span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository">
In this repository
</span>
<span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub">
All GitHub
</span>
<span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump">
Jump to
<span class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
</a>
</li>
<li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-global-search d-none" role="option">
<a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none">
<svg height="16" width="16" class="octicon octicon-repo flex-shrink-0 js-jump-to-octicon-repo d-none" title="Repository" aria-label="Repository" viewBox="0 0 12 16" version="1.1" role="img"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
<svg height="16" width="16" class="octicon octicon-project flex-shrink-0 js-jump-to-octicon-project d-none" title="Project" aria-label="Project" viewBox="0 0 15 16" version="1.1" role="img"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 00-1 1v14a1 1 0 001 1h13a1 1 0 001-1V1a1 1 0 00-1-1z"/></svg>
<svg height="16" width="16" class="octicon octicon-search flex-shrink-0 js-jump-to-octicon-search d-none" title="Search" aria-label="Search" viewBox="0 0 16 16" version="1.1" role="img"><path fill-rule="evenodd" d="M15.7 13.3l-3.81-3.83A5.93 5.93 0 0013 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 000-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"/></svg>
</div>
<img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="" width="28" height="28">
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target">
</div>
<div class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none js-jump-to-badge-search">
<span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository">
In this repository
</span>
<span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub">
All GitHub
</span>
<span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 bg-gray px-1 text-gray-light ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump">
Jump to
<span class="d-inline-block ml-1 v-align-middle">↵</span>
</div>
</a>
</li>
</ul>
</div>
</label>
</form> </div>
</div>
</div>
<a href="/login?return_to=%2Fcheeriojs%2Fcheerio"
class="HeaderMenu-link no-underline mr-3"
data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="8e2dcd7dffb87ea19270536be09c054707f990080cab409446da30211a7b25df"
data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">
Sign&nbsp;in
</a>
<a href="/join?source_repo=cheeriojs%2Fcheerio"
class="HeaderMenu-link d-inline-block no-underline border border-gray-dark rounded-1 px-2 py-1"
data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="8e2dcd7dffb87ea19270536be09c054707f990080cab409446da30211a7b25df"
data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">
Sign&nbsp;up
</a>
</div>
</div>
</div>
</header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container">
</div>
<div class="application-main " data-commit-hovercards-enabled>
<div itemscope itemtype="http://schema.org/SoftwareSourceCode" class="">
<main id="js-repo-pjax-container" data-pjax-container >
<div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav ">
<div class="repohead-details-container clearfix container">
<ul class="pagehead-actions">
<li>
<a class="tooltipped tooltipped-s btn btn-sm btn-with-count" aria-label="You must be signed in to watch a repository" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="e6ba612648744854ec20213f642ce665ef6ca4c2b82c12e80d55166d4ded7a96" href="/login?return_to=%2Fcheeriojs%2Fcheerio">
<svg class="octicon octicon-eye v-align-text-bottom" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
Watch
</a> <a class="social-count" href="/cheeriojs/cheerio/watchers"
aria-label="388 users are watching this repository">
388
</a>
</li>
<li>
<a class="btn btn-sm btn-with-count tooltipped tooltipped-s" aria-label="You must be signed in to star a repository" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:2541284,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9a486e53630b5627cf37430c0630ac627a1b16f1fd93ef18defbff05fcf830c3" href="/login?return_to=%2Fcheeriojs%2Fcheerio">
<svg class="octicon octicon-star v-align-text-bottom" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"/></svg>
Star
</a>
<a class="social-count js-social-count" href="/cheeriojs/cheerio/stargazers"
aria-label="20662 users starred this repository">
20.7k
</a>
</li>
<li>
<a class="btn btn-sm btn-with-count tooltipped tooltipped-s" aria-label="You must be signed in to fork a repository" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;repo details fork button&quot;,&quot;repository_id&quot;:2541284,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="846e9d4221cfe4fc4527dd85dda09e98502e083739ab396dcbdfca46b33758dc" href="/login?return_to=%2Fcheeriojs%2Fcheerio">
<svg class="octicon octicon-repo-forked v-align-text-bottom" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 00-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 002 1a1.993 1.993 0 00-1 3.72V6.5l3 3v1.78A1.993 1.993 0 005 15a1.993 1.993 0 001-3.72V9.5l3-3V4.72A1.993 1.993 0 008 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
Fork
</a>
<a href="/cheeriojs/cheerio/network/members" class="social-count"
aria-label="1316 users forked this repository">
1.3k
</a>
</li>
</ul>
<h1 class="public ">
<svg class="octicon octicon-repo" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
<span class="author" itemprop="author"><a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/cheeriojs/hovercard" href="/cheeriojs">cheeriojs</a></span><!--
--><span class="path-divider">/</span><!--
--><strong itemprop="name"><a data-pjax="#js-repo-pjax-container" href="/cheeriojs/cheerio">cheerio</a></strong>
</h1>
</div>
<nav class="hx_reponav reponav js-repo-nav js-sidenav-container-pjax container"
itemscope
itemtype="http://schema.org/BreadcrumbList"
aria-label="Repository"
data-pjax="#js-repo-pjax-container">
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a class="js-selected-navigation-item selected reponav-item" itemprop="url" data-hotkey="g c" aria-current="page" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages /cheeriojs/cheerio" href="/cheeriojs/cheerio">
<svg class="octicon octicon-code" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg>
<span itemprop="name">Code</span>
<meta itemprop="position" content="1">
</a> </span>
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a itemprop="url" data-hotkey="g i" class="js-selected-navigation-item reponav-item" data-selected-links="repo_issues repo_labels repo_milestones /cheeriojs/cheerio/issues" href="/cheeriojs/cheerio/issues">
<svg class="octicon octicon-issue-opened" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg>
<span itemprop="name">Issues</span>
<span class="Counter">197</span>
<meta itemprop="position" content="2">
</a> </span>
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a data-hotkey="g p" itemprop="url" class="js-selected-navigation-item reponav-item" data-selected-links="repo_pulls checks /cheeriojs/cheerio/pulls" href="/cheeriojs/cheerio/pulls">
<svg class="octicon octicon-git-pull-request" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0010 15a1.993 1.993 0 001-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 00-1 3.72v6.56A1.993 1.993 0 002 15a1.993 1.993 0 001-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
<span itemprop="name">Pull requests</span>
<span class="Counter">23</span>
<meta itemprop="position" content="3">
</a> </span>
<a data-hotkey="g b" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /cheeriojs/cheerio/projects" href="/cheeriojs/cheerio/projects">
<svg class="octicon octicon-project" viewBox="0 0 15 16" version="1.1" width="15" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 00-1 1v14a1 1 0 001 1h13a1 1 0 001-1V1a1 1 0 00-1-1z"/></svg>
Projects
<span class="Counter" >1</span>
</a>
<a class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /cheeriojs/cheerio/wiki" href="/cheeriojs/cheerio/wiki">
<svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg>
Wiki
</a>
<a data-skip-pjax="true" class="js-selected-navigation-item reponav-item" data-selected-links="security alerts policy code_scanning /cheeriojs/cheerio/security/advisories" href="/cheeriojs/cheerio/security/advisories">
<svg class="octicon octicon-shield" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M0 2l7-2 7 2v6.02C14 12.69 8.69 16 7 16c-1.69 0-7-3.31-7-7.98V2zm1 .75L7 1l6 1.75v5.268C13 12.104 8.449 15 7 15c-1.449 0-6-2.896-6-6.982V2.75zm1 .75L7 2v12c-1.207 0-5-2.482-5-5.985V3.5z"/></svg>
Security
</a>
<a class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors dependency_graph pulse people /cheeriojs/cheerio/pulse" href="/cheeriojs/cheerio/pulse">
<svg class="octicon octicon-graph" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg>
Insights
</a>
</nav>
</div>
<div class="container-lg clearfix new-discussion-timeline experiment-repo-nav px-3">
<div class="repository-content ">
<div class="signup-prompt-bg rounded-1">
<div class="signup-prompt p-4 text-center mb-4 rounded-1">
<div class="position-relative">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form action="/prompt_dismissals/signup" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="put" /><input type="hidden" name="authenticity_token" value="VOPQjPpAXIKY+3ef3kQnsmYc6SxZxMw/BHnYqj7blrEFT0xs9ooiMhtSaiM8gjFrFABl036hoQRbdj+FtmrvWQ==" />
<button type="submit" class="position-absolute top-0 right-0 btn-link link-gray" data-ga-click="(Logged out) Sign up prompt, clicked Dismiss, text:dismiss">
Dismiss
</button>
</form> <h3 class="pt-2">Join GitHub today</h3>
<p class="col-6 mx-auto">GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.</p>
<a class="btn btn-primary" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;files signup prompt&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="9c037f56dcda69a8dcb378b71643d74dc84d9c7874c75b9ebc492d12abe8fc25" data-ga-click="(Logged out) Sign up prompt, clicked Sign up, text:sign-up" href="/join?source=prompt-code&amp;source_repo=cheeriojs%2Fcheerio">Sign up</a>
</div>
</div>
</div>
<div class="mb-3"> <div class="f4">
<span class="text-gray-dark mr-2" itemprop="about">
Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
</span>
<span itemprop="url"><a rel="nofollow" href="https://cheerio.js.org/">https://cheerio.js.org/</a></span>
</div>
</div>
<div class="overall-summary overall-summary-bottomless">
<ul class="numbers-summary">
<li class="commits">
<a data-pjax href="/cheeriojs/cheerio/commits/v1.0.0">
<svg class="octicon octicon-history" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 13H6V6h5v2H8v5zM7 1C4.81 1 2.87 2.02 1.59 3.59L0 2v4h4L2.5 4.5C3.55 3.17 5.17 2.3 7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-.34.03-.67.09-1H.08C.03 7.33 0 7.66 0 8c0 3.86 3.14 7 7 7s7-3.14 7-7-3.14-7-7-7z"/></svg>
<span class="num text-emphasized">
1,113
</span>
commits
</a>
</li>
<li>
<a data-pjax href="/cheeriojs/cheerio/branches">
<svg class="octicon octicon-git-branch" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 00-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 00-1-3.72C.88 1 0 1.89 0 3a2 2 0 001 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
<span class="num text-emphasized">
112
</span>
branches
</a>
</li>
<li>
<a href="/cheeriojs/cheerio/releases">
<svg class="octicon octicon-tag" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.73 1.73C7.26 1.26 6.62 1 5.96 1H3.5C2.13 1 1 2.13 1 3.5v2.47c0 .66.27 1.3.73 1.77l6.06 6.06c.39.39 1.02.39 1.41 0l4.59-4.59a.996.996 0 000-1.41L7.73 1.73zM2.38 7.09c-.31-.3-.47-.7-.47-1.13V3.5c0-.88.72-1.59 1.59-1.59h2.47c.42 0 .83.16 1.13.47l6.14 6.13-4.73 4.73-6.13-6.15zM3.01 3h2v2H3V3h.01z"/></svg>
<span class="num text-emphasized">
55
</span>
releases
</a>
</li>
<li >
<a href="/cheeriojs/cheerio/graphs/contributors">
<svg class="octicon octicon-organization" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 12.999c0 .439-.45 1-1 1H7.995c-.539 0-.994-.447-.995-.999H1c-.54 0-1-.561-1-1 0-2.634 3-4 3-4s.229-.409 0-1c-.841-.621-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.442.58 2.5 3c.058 2.41-.159 2.379-1 3-.229.59 0 1 0 1s1.549.711 2.42 2.088C9.196 9.369 10 8.999 10 8.999s.229-.409 0-1c-.841-.62-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.437.581 2.495 3c.059 2.41-.158 2.38-1 3-.229.59 0 1 0 1s3.005 1.366 3.005 4z"/></svg>
<span class="num text-emphasized">
100
</span>
contributors
</a>
</li>
<li>
<a href="/cheeriojs/cheerio/blob/v1.0.0/LICENSE">
<svg class="octicon octicon-law" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z"/></svg>
MIT
</a>
</li>
</ul>
</div>
<details class="details-reset">
<summary title="Click for language details" data-ga-click="Repository, language bar stats toggle, location:repo overview">
<div class="d-flex repository-lang-stats-graph">
<span class="language-color" aria-label="JavaScript 79.1%" style="width:79.1%; background-color:#f1e05a;" itemprop="keywords">JavaScript</span>
<span class="language-color" aria-label="HTML 20.2%" style="width:20.2%; background-color:#e34c26;" itemprop="keywords">HTML</span>
<span class="language-color" aria-label="Other 0.7%" style="width:0.7%; background-color:#ededed;" itemprop="keywords">Other</span>
</div>
</summary>
<div class="repository-lang-stats">
<ol class="repository-lang-stats-numbers">
<li>
<a href="/cheeriojs/cheerio/search?l=javascript" data-ga-click="Repository, language stats search click, location:repo overview">
<span class="color-block language-color" style="background-color:#f1e05a;"></span>
<span class="lang">JavaScript</span>
<span class="percent">79.1%</span>
</a>
</li>
<li>
<a href="/cheeriojs/cheerio/search?l=html" data-ga-click="Repository, language stats search click, location:repo overview">
<span class="color-block language-color" style="background-color:#e34c26;"></span>
<span class="lang">HTML</span>
<span class="percent">20.2%</span>
</a>
</li>
<li>
<span>
<span class="color-block language-color" style="background-color:#ededed;"></span>
<span class="lang">Other</span>
<span class="percent">0.7%</span>
</span>
</li>
</ol>
</div>
</details>
<div class="file-navigation in-mid-page d-flex flex-items-start">
<details class="details-reset details-overlay select-menu branch-select-menu hx_rsm" id="branch-select-menu">
<summary class="btn btn-sm select-menu-button css-truncate"
data-hotkey="w"
title="Switch branches or tags">
<i>Branch:</i>
<span class="css-truncate-target" data-menu-button>v1.0.0</span>
</summary>
<details-menu class="select-menu-modal hx_rsm-modal position-absolute" style="z-index: 99;" src="/cheeriojs/cheerio/ref-list/v1.0.0?source_action=disambiguate&amp;source_controller=files" preload>
<include-fragment class="select-menu-loading-overlay anim-pulse">
<svg height="32" class="octicon octicon-octoface" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M14.7 5.34c.13-.32.55-1.59-.13-3.31 0 0-1.05-.33-3.44 1.3-1-.28-2.07-.32-3.13-.32s-2.13.04-3.13.32c-2.39-1.64-3.44-1.3-3.44-1.3-.68 1.72-.26 2.99-.13 3.31C.49 6.21 0 7.33 0 8.69 0 13.84 3.33 15 7.98 15S16 13.84 16 8.69c0-1.36-.49-2.48-1.3-3.35zM8 14.02c-3.3 0-5.98-.15-5.98-3.35 0-.76.38-1.48 1.02-2.07 1.07-.98 2.9-.46 4.96-.46 2.07 0 3.88-.52 4.96.46.65.59 1.02 1.3 1.02 2.07 0 3.19-2.68 3.35-5.98 3.35zM5.49 9.01c-.66 0-1.2.8-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.54-1.78-1.2-1.78zm5.02 0c-.66 0-1.2.79-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.53-1.78-1.2-1.78z"/></svg>
</include-fragment>
</details-menu>
</details>
<button type="button" class="btn btn-sm disabled tooltipped tooltipped-n new-pull-request-btn" aria-label="You must be signed in to create a pull request">
New pull request
</button>
<div class="breadcrumb flex-auto">
</div>
<div class="BtnGroup">
<a class="btn btn-sm empty-icon float-right BtnGroup-item" data-hydro-click="{&quot;event_type&quot;:&quot;repository.click&quot;,&quot;payload&quot;:{&quot;target&quot;:&quot;FIND_FILE_BUTTON&quot;,&quot;repository_id&quot;:2541284,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="4003fc51e7463d02b68534b7d217c8cb86a93af667d7cfb7eefb2cee3c03f9a6" data-ga-click="Repository, find file, location:repo overview" data-hotkey="t" data-pjax="true" href="/cheeriojs/cheerio/find/v1.0.0">Find file</a>
</div>
<details class="get-repo-select-menu js-get-repo-select-menu js-anon-get-repo-select-menu position-relative details-overlay details-reset">
<summary class="btn btn-sm ml-2 btn-primary" data-hydro-click="{&quot;event_type&quot;:&quot;repository.click&quot;,&quot;payload&quot;:{&quot;repository_id&quot;:2541284,&quot;target&quot;:&quot;CLONE_OR_DOWNLOAD_BUTTON&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="0ffd717134ec6d59a3c4b4a09b7eaeab05ac635b34b059320f4fc8b03d66fbc5">
Clone or download
<span class="dropdown-caret"></span>
</summary> <div class="position-relative">
<div class="get-repo-modal dropdown-menu dropdown-menu-sw pb-0 js-toggler-container js-get-repo-modal">
<div class="get-repo-modal-options">
<div class="clone-options https-clone-options">
<h4 class="mb-1">
Clone with HTTPS
<a class="muted-link" href="https://help.github.com/articles/which-remote-url-should-i-use" target="_blank" title="Which remote URL should I use?">
<svg class="octicon octicon-question" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6 10h2v2H6v-2zm4-3.5C10 8.64 8 9 8 9H6c0-.55.45-1 1-1h.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5V7H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"/></svg>
</a>
</h4>
<p class="mb-2 get-repo-decription-text">
Use Git or checkout with SVN using the web URL.
</p>
<div class="input-group">
<input type="text" class="form-control input-monospace input-sm" data-autoselect value="https://github.com/cheeriojs/cheerio.git" aria-label="Clone this repository at https://github.com/cheeriojs/cheerio.git" readonly>
<div class="input-group-button">
<clipboard-copy value="https://github.com/cheeriojs/cheerio.git" aria-label="Copy to clipboard" class="btn btn-sm" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;COPY_URL&quot;,&quot;git_repository_type&quot;:&quot;REPOSITORY&quot;,&quot;repository_id&quot;:2541284,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="ccd0ef1bef673b9a23d0a5237d10ec06c2bd28eb75deadd5f3e5dadbd74c0e45"><svg class="octicon octicon-clippy" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg></clipboard-copy>
</div>
</div>
</div>
<div class="mt-2">
<a class="btn btn-outline get-repo-btn js-anon-download-zip-link " rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;DOWNLOAD_ZIP&quot;,&quot;git_repository_type&quot;:&quot;REPOSITORY&quot;,&quot;repository_id&quot;:2541284,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5f1ad8337a147c556e1b7e88cec847bc6ae4d1024125be82524ec7b740718926" data-ga-click="Repository, download zip, location:repo overview" href="/cheeriojs/cheerio/archive/v1.0.0.zip">Download ZIP</a>
</div>
</div>
<div class="js-modal-downloading" hidden>
<div class="py-2 px-3">
<h4 class="lh-condensed mb-3">Downloading<span class="animated-ellipsis-container"><span class="animated-ellipsis">...</span></span></h4>
<p class="text-gray">
Want to be notified of new releases in
<span class="text-bold">cheeriojs/cheerio</span>?
</p>
</div>
<div class="width-full d-flex">
<a rel="nofollow" class="get-repo-btn btn btn-outline" style="width: 50%" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;download popover&quot;,&quot;repository_id&quot;:2541284,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="e5f7097d698a39ff37f79e47514173ba1b8a8028dac4fc922f785465f2b5e217" href="/login?return_to=https%3A%2F%2Fgithub.com%2Fcheeriojs%2Fcheerio">Sign in</a>
<a rel="nofollow" class="get-repo-btn btn btn-primary" style="width: 50%" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;download popover&quot;,&quot;repository_id&quot;:2541284,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}" data-hydro-click-hmac="ba1942d8a7237bfccd6a634b5e1dfc93458e883220ac7bc12328ab3483708ba1" href="/join?return_to=%2Fcheeriojs%2Fcheerio">Sign up</a>
</div>
</div>
<div class="js-modal-download-mac py-2 px-3 d-none">
<h4 class="lh-condensed mb-3">Launching GitHub Desktop<span class="animated-ellipsis-container"><span class="animated-ellipsis">...</span></span></h4>
<p class="text-gray">If nothing happens, <a href="https://desktop.github.com/">download GitHub Desktop</a> and try again.</p>
<p><button class="btn-link js-get-repo-modal-download-back">Go back</button></p>
</div>
<div class="js-modal-download-windows py-2 px-3 d-none">
<h4 class="lh-condensed mb-3">Launching GitHub Desktop<span class="animated-ellipsis-container"><span class="animated-ellipsis">...</span></span></h4>
<p class="text-gray">If nothing happens, <a href="https://desktop.github.com/">download GitHub Desktop</a> and try again.</p>
<p><button class="btn-link js-get-repo-modal-download-back">Go back</button></p>
</div>
<div class="js-modal-download-xcode py-2 px-3 d-none">
<h4 class="lh-condensed mb-3">Launching Xcode<span class="animated-ellipsis-container"><span class="animated-ellipsis">...</span></span></h4>
<p class="text-gray">If nothing happens, <a href="https://developer.apple.com/xcode/">download Xcode</a> and try again.</p>
<p><button class="btn-link js-get-repo-modal-download-back">Go back</button></p>
</div>
<div class="js-modal-download-visual-studio py-2 px-3 d-none">
<h4 class="lh-condensed mb-3">Launching Visual Studio<span class="animated-ellipsis-container"><span class="animated-ellipsis">...</span></span></h4>
<p class="text-gray">If nothing happens, <a href="https://visualstudio.github.com/">download the GitHub extension for Visual Studio</a> and try again.</p>
<p><button class="btn-link js-get-repo-modal-download-back">Go back</button></p>
</div>
</div>
</div>
</details>
</div>
<div class="commit-tease js-details-container Details d-flex rounded-top-1" data-issue-and-pr-hovercards-enabled>
<div class="AvatarStack flex-self-start AvatarStack--two">
<div class="AvatarStack-body" aria-label="curbengh and fb55 (non-author committer)">
<a class="avatar" data-skip-pjax="true" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=43627182" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/curbengh">
<img height="20" width="20" alt="@curbengh" src="https://avatars3.githubusercontent.com/u/43627182?s=60&amp;v=4" />
</a> <a class="avatar" data-skip-pjax="true" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=188768" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/fb55">
<img height="20" width="20" alt="@fb55" src="https://avatars3.githubusercontent.com/u/188768?s=60&amp;v=4" />
</a> </div>
</div>
<div class="flex-auto f6 mr-3">
<a href="/cheeriojs/cheerio/commits?author=curbengh"
class="commit-author tooltipped tooltipped-s user-mention"
aria-label="View all commits by curbengh">curbengh</a>
and <a href="/cheeriojs/cheerio/commits?author=fb55"
class="commit-author tooltipped tooltipped-s user-mention"
aria-label="View all commits by fb55">fb55</a>
<a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="message text-inherit" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">test: replace istanbul with nyc (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="475615675" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1337" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1337/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1337">#1337</a><a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="message text-inherit" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">)</a>
<span class="hidden-text-expander inline">
<button type="button" class="ellipsis-expander js-details-target" aria-expanded="false">&hellip;</button>
</span>
<div class="commit-desc"><pre class="text-small">* test: replace istanbul with nyc
* chore: update package-lock</pre></div>
</div>
<div class="no-wrap d-flex flex-self-start flex-items-baseline">
<span class="mr-1">Latest commit</span>
<a class="commit-tease-sha mr-1" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f" data-pjax>
e6e648e
</a>
<span itemprop="dateModified"><relative-time datetime="2019-08-28T00:00:59Z" class="no-wrap">Aug 28, 2019</relative-time></span>
</div>
</div>
<include-fragment class="file-wrap" src="/cheeriojs/cheerio/file-list/v1.0.0">
<a class="d-none js-permalink-shortcut" data-hotkey="y" href="/cheeriojs/cheerio/tree/e6e648e19018af432751182769fc92ce1d44ff3f">Permalink</a>
<table class="files js-navigation-container js-active-navigation-container" data-pjax>
<thead>
<tr>
<th><span class="sr-only">Type</span></th>
<th><span class="sr-only">Name</span></th>
<th><span class="sr-only">Latest commit message</span></th>
<th><span class="sr-only">Commit time</span></th>
</tr>
</thead>
<tbody>
<tr class="warning include-fragment-error">
<td class="icon"><svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 000 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 00.01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg></td>
<td class="content" colspan="3">Failed to load latest commit information.</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title=".github" id="01777e4a9846fea5f3fcc8fe40d44680-3f186548027c1fe2d7b68f4810a3fbccd34a4064" href="/cheeriojs/cheerio/tree/v1.0.0/.github">.github</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Create issue_template.md" class="link-gray" href="/cheeriojs/cheerio/commit/e11f5cd61a81ec58f76864504c7de282c4d0a516">Create issue_template.md</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2017-07-28T10:06:35Z" class="no-wrap">Jul 28, 2017</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="benchmark" id="07978586e47c8709a63e895fbf3c3c7d-0f51c1e4bd5af95f0d7fbc52d36f3f107f9f6de0" href="/cheeriojs/cheerio/tree/v1.0.0/benchmark">benchmark</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Fix benchmark" class="link-gray" href="/cheeriojs/cheerio/commit/f9a7f5c6523e2922e389468201049a67ade4742b">Fix benchmark</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:54:35Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="This path skips through empty directories" id="cdf24f5097821f0df7ee8f06e087cd19-f5f83c295f17bbed8ea6657870e824155bbd23fe" href="/cheeriojs/cheerio/tree/v1.0.0/docs/template"><span class="simplified-path">docs/</span>template</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Customize documentation template
- Remove the name &quot;JSDoc&quot; from the document title
- Present JSDoc &quot;mixins&quot; as API &quot;categories&quot;
- De-emphasize deprecated methods via HTML `&lt;details&gt;` elements" class="link-gray" href="/cheeriojs/cheerio/commit/2ef2fd315468bc0d56e07a776a6719f269c75318">Customize documentation template</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-11-01T23:39:59Z" class="no-wrap">Nov 1, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="lib" id="e8acc63b1e238f3255c900eed37254b8-ce7bec7a2c2379632e9fb0f2bfedee079de8a215" href="/cheeriojs/cheerio/tree/v1.0.0/lib">lib</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Fix location handling for parse5
and port test case from #1303" class="link-gray" href="/cheeriojs/cheerio/commit/69142c721f507b9501a47b8482b0c16dfdce1438">Fix location handling for parse5</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:27:34Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="scripts" id="d6c5855a62cf32a4dadbc2831f0f295f-516e74f434d76aecd714713255bf1e76ff0b9b84" href="/cheeriojs/cheerio/tree/v1.0.0/scripts">scripts</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Improve release process
Limit responsibility of &quot;pre-publish&quot; script to simply validate the
project&#39;s `History.md` file (by verifying an entry for the current
release). Define a separate script for history generation. Separating
the workflow in this way allows for manual modification of the release
notes." class="link-gray" href="/cheeriojs/cheerio/commit/310c2cd4173beaecfe867c7363951b181030f5e6">Improve release process</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-03-09T15:42:05Z" class="no-wrap">Mar 9, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="directory" class="octicon octicon-file-directory" viewBox="0 0 14 16" version="1.1" width="14" height="16" role="img"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="test" id="098f6bcd4621d373cade4e832627b4f6-0933f62322fdc05b03cc5f7f2f8ac241a0987a15" href="/cheeriojs/cheerio/tree/v1.0.0/test">test</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Fix location handling for parse5
and port test case from #1303" class="link-gray" href="/cheeriojs/cheerio/commit/69142c721f507b9501a47b8482b0c16dfdce1438">Fix location handling for parse5</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:27:34Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title=".eslintrc.json" id="df39304d828831c44a2b9f38cd45289c-838a6e3b25be363511217f4808cff8e6b89d5831" href="/cheeriojs/cheerio/blob/v1.0.0/.eslintrc.json">.eslintrc.json</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Update dependencies" class="link-gray" href="/cheeriojs/cheerio/commit/b0862ee1f5df91857902cfea18d4cb0a4381dfff">Update dependencies</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:11:18Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title=".gitignore" id="a084b794bc0759e7a6b77810e01874f2-2758158fa7945fc9099f5ff620e5480458c16370" href="/cheeriojs/cheerio/blob/v1.0.0/.gitignore">.gitignore</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">test: replace istanbul with nyc (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="475615675" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1337" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1337/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1337">#1337</a><a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">)</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-08-28T00:00:59Z" class="no-wrap">Aug 28, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title=".travis.yml" id="354f30a63fb0907d4ad57269548329e3-ee20bf5c314face3cac1a4e488c5ded6d964c22f" href="/cheeriojs/cheerio/blob/v1.0.0/.travis.yml">.travis.yml</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Run tests on all LTS versions" class="link-gray" href="/cheeriojs/cheerio/commit/3c720fb193b6ab4df1c14a2eebd277b9cd8f2606">Run tests on all LTS versions</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:56:15Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="CNAME" id="adc4bfdb0829dae99e3699393e3fbaa4-c9cd136f798c62437daca04d209bb135c37a948d" href="/cheeriojs/cheerio/blob/v1.0.0/CNAME">CNAME</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Create CNAME" class="link-gray" href="/cheeriojs/cheerio/commit/021e3c214ed0fa692f4ab87da5ad566e1fe2a097">Create CNAME</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-03-06T01:08:32Z" class="no-wrap">Mar 6, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="CONTRIBUTING.md" id="6a3371457528722a734f3c51d9238c13-24f458fdee0cb2363dac0faad757f0967f7e111c" href="/cheeriojs/cheerio/blob/v1.0.0/CONTRIBUTING.md">CONTRIBUTING.md</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Use eslint &amp; prettier, add precommit hook (#1152)" class="link-gray" href="/cheeriojs/cheerio/commit/67a9271a6461bf604f62dd3aefb673469e589388">Use eslint &amp; prettier, add precommit hook (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="300811933" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1152" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1152/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1152">#1152</a><a data-pjax="true" title="Use eslint &amp; prettier, add precommit hook (#1152)" class="link-gray" href="/cheeriojs/cheerio/commit/67a9271a6461bf604f62dd3aefb673469e589388">)</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-03-11T15:04:19Z" class="no-wrap">Mar 11, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="History.md" id="e1bbd4f15e3b63427b4261e05b948ea8-4bc79b735eee1e8a5ea0b2a3d79266fde741b59a" href="/cheeriojs/cheerio/blob/v1.0.0/History.md">History.md</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Add history for 1.0.0-rc.3" class="link-gray" href="/cheeriojs/cheerio/commit/96ad433b837bfae19f07f23a0dd6e8008976e612">Add history for 1.0.0-rc.3</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-06-26T18:30:25Z" class="no-wrap">Jun 26, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="LICENSE" id="9879d6db96fd29134fc802214163b95a-40b9100df04cf5edf5b091a8fccc76b3deaf9e1c" itemprop="license" href="/cheeriojs/cheerio/blob/v1.0.0/LICENSE">LICENSE</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="Makefile" id="b67911656ef5d18c4ae36cb6741b7965-255a27993f9d8f619a832924ebfc66c413824da5" href="/cheeriojs/cheerio/blob/v1.0.0/Makefile">Makefile</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">test: replace istanbul with nyc (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="475615675" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1337" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1337/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1337">#1337</a><a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">)</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-08-28T00:00:59Z" class="no-wrap">Aug 28, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="Readme.md" id="1e290ac8433d555bce009b162cb869d0-bdbb0662b4855881f6610d1441743f0207f641f6" href="/cheeriojs/cheerio/blob/v1.0.0/Readme.md">Readme.md</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Remove references to deprecated APIs from docs" class="link-gray" href="/cheeriojs/cheerio/commit/bfd84be09ecf76faed9fbddd39fd8559461f343f">Remove references to deprecated APIs from docs</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-01-30T03:29:10Z" class="no-wrap">Jan 30, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="_config.yml" id="aeb42283af8ef8e9da40ededd3ae2ab2-c4192631f25b34d77a7f159aa0da0e3ae99c4ef4" href="/cheeriojs/cheerio/blob/v1.0.0/_config.yml">_config.yml</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Set theme jekyll-theme-cayman" class="link-gray" href="/cheeriojs/cheerio/commit/d151d8008ddb8af11bc9f4c3dbf1c51ae0f52ff8">Set theme jekyll-theme-cayman</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-03-06T01:08:54Z" class="no-wrap">Mar 6, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="index.js" id="168726dbe96b3ce427e7fedce31bb0bc-6bf45d472d3585b382f50010db6c4902a67a8de9" href="/cheeriojs/cheerio/blob/v1.0.0/index.js">index.js</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Correct structure of generated documentation
Reformat the project source to ensure proper organization of the
procedurally-generated API documentation. This includes documenting
aliased methods independently (e.g. `cheerio.html` and `$.html`) and
accurately communicating the distinction between the Cheerio module and
the Cheerio class.
This change uses the `hideconstructor` JSDoc &quot;tag&quot; name in order to
discourage the use of a low-level function. The linting rules do not
currently recognize the tag, so this patch also adds explicit
configuration to allow it. This may be removed if the linting tool is
patched with support [1].
JSDoc does not currently allow the identified `exports` to be used to
define a so-called &quot;mixin.&quot; This is problematic because the mixin is the
most appropriate type for describing the relationship between Cheerio&#39;s
internal modules and the Cheerio object. A fix has been implemented and
submitted upstream [2]; update this project&#39;s dependencies to rely on
the patched version.
[1] https://github.com/gajus/eslint-plugin-jsdoc/issues/96
[2] https://github.com/jsdoc3/jsdoc/pull/1575" class="link-gray" href="/cheeriojs/cheerio/commit/dbe3320bf2a684db271c0bb7b85c43d4de2e6a9a">Correct structure of generated documentation</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-11-01T23:39:59Z" class="no-wrap">Nov 1, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="jsdoc-config.json" id="7a20641d3102c2124c5a4be18c16ad03-ae231cf0eda13bd0a5511c7b86660f11673f6842" href="/cheeriojs/cheerio/blob/v1.0.0/jsdoc-config.json">jsdoc-config.json</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="Include default documentation template
The `jsdoc` module provides a default documentation template, but it is
not entirely appropriate for use by Cheerio. Fortunately, JSDoc allows
users to customize the template. Include the default template without
modification so that the necessary customizations can be tracked in the
version control history (via forthcoming commits)." class="link-gray" href="/cheeriojs/cheerio/commit/5451649b912e17da5f7fecb82e4b20122f4223d8">Include default documentation template</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2018-11-01T23:39:59Z" class="no-wrap">Nov 1, 2018</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="package-lock.json" id="32607347f8126e6534ebc7ebaec4853d-6255b0e455482fb1758c9f3e9d0c3437294f10b4" href="/cheeriojs/cheerio/blob/v1.0.0/package-lock.json">package-lock.json</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">test: replace istanbul with nyc (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="475615675" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1337" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1337/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1337">#1337</a><a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">)</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-08-28T00:00:59Z" class="no-wrap">Aug 28, 2019</time-ago></span>
</td>
</tr>
<tr class="js-navigation-item">
<td class="icon">
<svg aria-label="file" class="octicon octicon-file" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"/></svg>
<img width="16" height="16" class="spinner" alt="" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif" />
</td>
<td class="content">
<span class="css-truncate css-truncate-target"><a class="js-navigation-open" title="package.json" id="b9cfc7f2cdf78a7f4b91a753d10865a2-bfd13e2fbdc04902183ae7d94d13a37e4e8f0bdd" href="/cheeriojs/cheerio/blob/v1.0.0/package.json">package.json</a></span>
</td>
<td class="message">
<span class="css-truncate css-truncate-target">
<a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">test: replace istanbul with nyc (</a><a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="475615675" data-permission-text="Issue title is private" data-url="https://github.com/cheeriojs/cheerio/issues/1337" data-hovercard-type="pull_request" data-hovercard-url="/cheeriojs/cheerio/pull/1337/hovercard" href="https://github.com/cheeriojs/cheerio/pull/1337">#1337</a><a data-pjax="true" title="test: replace istanbul with nyc (#1337)
* test: replace istanbul with nyc
* chore: update package-lock" class="link-gray" href="/cheeriojs/cheerio/commit/e6e648e19018af432751182769fc92ce1d44ff3f">)</a>
</span>
</td>
<td class="age">
<span class="css-truncate css-truncate-target"><time-ago datetime="2019-08-28T00:00:59Z" class="no-wrap">Aug 28, 2019</time-ago></span>
</td>
</tr>
</tbody>
</table>
</include-fragment>
<div id="readme" class="Box Box--condensed instapaper_body md js-code-block-container">
<div class="Box-header d-flex flex-items-center flex-justify-between px-2">
<h3 class="Box-title pr-3">
<svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg>
Readme.md
</h3>
</div>
<div class="Popover anim-scale-in js-tagsearch-popover"
hidden
data-tagsearch-url="/cheeriojs/cheerio/find-symbols"
data-tagsearch-ref="v1.0.0"
data-tagsearch-path="Readme.md"
data-tagsearch-lang="Markdown"
data-hydro-click="{&quot;event_type&quot;:&quot;code_navigation.click_on_symbol&quot;,&quot;payload&quot;:{&quot;action&quot;:&quot;click_on_symbol&quot;,&quot;repository_id&quot;:2541284,&quot;ref&quot;:&quot;v1.0.0&quot;,&quot;language&quot;:&quot;Markdown&quot;,&quot;client_id&quot;:null,&quot;originating_request_id&quot;:&quot;80F4:2D001:1110A2A:1A19495:5DC924C0&quot;,&quot;originating_url&quot;:&quot;https://github.com/cheeriojs/cheerio&quot;,&quot;referrer&quot;:null,&quot;user_id&quot;:null}}"
data-hydro-click-hmac="0c2426dea3fde034612c13946f575d41a2b6ce2874f5e1ae8dfce6b376fc80c5">
<div class="Popover-message Popover-message--large Popover-message--top-left TagsearchPopover mt-1 mb-4 mx-auto Box box-shadow-large">
<div class="TagsearchPopover-content js-tagsearch-popover-content overflow-auto" style="will-change:transform;">
</div>
</div>
</div>
<div class="Box-body">
<article class="markdown-body entry-content p-5" itemprop="text"><h1 align="center"><a id="user-content-cheerio" class="anchor" aria-hidden="true" href="#cheerio"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>cheerio</h1>
<h5 align="center"><a id="user-content-fast-flexible--lean-implementation-of-core-jquery-designed-specifically-for-the-server" class="anchor" aria-hidden="true" href="#fast-flexible--lean-implementation-of-core-jquery-designed-specifically-for-the-server"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Fast, flexible &amp; lean implementation of core jQuery designed specifically for the server.</h5>
<div align="center">
<a href="http://travis-ci.org/cheeriojs/cheerio" rel="nofollow">
<img src="https://camo.githubusercontent.com/9a403110cf31fdf9008dc20b01d0eca88505884b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6368656572696f6a732f6368656572696f2e7376673f6272616e63683d6d6173746572" alt="Travis CI" data-canonical-src="https://secure.travis-ci.org/cheeriojs/cheerio.svg?branch=master" style="max-width:100%;">
</a>
<a href="https://coveralls.io/r/cheeriojs/cheerio" rel="nofollow">
<img src="https://camo.githubusercontent.com/f7385be975423dac2aa95430b064641690bd8968/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6368656572696f6a732f6368656572696f2e7376673f6272616e63683d6d6173746572267374796c653d666c6174" alt="Coverage" data-canonical-src="http://img.shields.io/coveralls/cheeriojs/cheerio.svg?branch=master&amp;style=flat" style="max-width:100%;">
</a>
<a href="https://gitter.im/cheeriojs/cheerio?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge" rel="nofollow">
<img src="https://camo.githubusercontent.com/da2edb525cde1455a622c58c0effc3a90b9a181c/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667" alt="Join the chat at https://gitter.im/cheeriojs/cheerio" data-canonical-src="https://badges.gitter.im/Join%20Chat.svg" style="max-width:100%;">
</a>
<a href="#backers">
<img src="https://camo.githubusercontent.com/372c55e69f51a869bef95d25daa091ec84e32b74/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b6572732f62616467652e737667" alt="OpenCollective backers" data-canonical-src="https://opencollective.com/cheerio/backers/badge.svg" style="max-width:100%;">
</a>
<a href="#sponsors">
<img src="https://camo.githubusercontent.com/200d0249fd8c621921639e4006c9737de988c999/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f72732f62616467652e737667" alt="OpenCollective sponsors" data-canonical-src="https://opencollective.com/cheerio/sponsors/badge.svg" style="max-width:100%;">
</a>
</div>
<br>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">cheerio</span> <span class="pl-k">=</span> <span class="pl-c1">require</span>(<span class="pl-s"><span class="pl-pds">'</span>cheerio<span class="pl-pds">'</span></span>)
<span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(<span class="pl-s"><span class="pl-pds">'</span>&lt;h2 class="title"&gt;Hello world&lt;/h2&gt;<span class="pl-pds">'</span></span>)
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>h2.title<span class="pl-pds">'</span></span>).<span class="pl-c1">text</span>(<span class="pl-s"><span class="pl-pds">'</span>Hello there!<span class="pl-pds">'</span></span>)
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>h2<span class="pl-pds">'</span></span>).<span class="pl-en">addClass</span>(<span class="pl-s"><span class="pl-pds">'</span>welcome<span class="pl-pds">'</span></span>)
<span class="pl-smi">$</span>.<span class="pl-en">html</span>()
<span class="pl-c"><span class="pl-c">//</span>=&gt; &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;h2 class="title welcome"&gt;Hello there!&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;</span></pre></div>
<h2><a id="user-content-installation" class="anchor" aria-hidden="true" href="#installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2>
<p><code>npm install cheerio</code></p>
<h2><a id="user-content-features" class="anchor" aria-hidden="true" href="#features"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Features</h2>
<p><strong>❤ Familiar syntax:</strong>
Cheerio implements a subset of core jQuery. Cheerio removes all the DOM inconsistencies and browser cruft from the jQuery library, revealing its truly gorgeous API.</p>
<p><strong>ϟ Blazingly fast:</strong>
Cheerio works with a very simple, consistent DOM model. As a result parsing, manipulating, and rendering are incredibly efficient. Preliminary end-to-end benchmarks suggest that cheerio is about <strong>8x</strong> faster than JSDOM.</p>
<p><strong>❁ Incredibly flexible:</strong>
Cheerio wraps around <a href="https://github.com/inikulin/parse5">parse5</a> parser and can optionally use @FB55's forgiving <a href="https://github.com/fb55/htmlparser2/">htmlparser2</a>. Cheerio can parse nearly any HTML or XML document.</p>
<h2><a id="user-content-cheerio-is-not-a-web-browser" class="anchor" aria-hidden="true" href="#cheerio-is-not-a-web-browser"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Cheerio is not a web browser</h2>
<p>Cheerio parses markup and provides an API for traversing/manipulating the resulting data structure. It does not interpret the result as a web browser does. Specifically, it does <em>not</em> produce a visual rendering, apply CSS, load external resources, or execute JavaScript. If your use case requires any of this functionality, you should consider projects like <a href="http://phantomjs.org/" rel="nofollow">PhantomJS</a> or <a href="https://github.com/tmpvar/jsdom">JSDom</a>.</p>
<h2><a id="user-content-sponsors" class="anchor" aria-hidden="true" href="#sponsors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sponsors</h2>
<p>Does your company use Cheerio in production? Please consider <a href="https://opencollective.com/cheerio#sponsor" rel="nofollow">sponsoring this project</a>. Your help will allow maintainers to dedicate more time and resources to its development and support.</p>
<p><a href="https://opencollective.com/cheerio/sponsor/0/website" rel="nofollow"><img src="https://camo.githubusercontent.com/24d86c14299068140c4a8d86b169588e2c567c49/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/0/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/1/website" rel="nofollow"><img src="https://camo.githubusercontent.com/46a99733359d433e273b63fd1262a51e0056a76a/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/1/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/2/website" rel="nofollow"><img src="https://camo.githubusercontent.com/d82ee355509c694a3267a0e8be5d669140550230/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/2/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/3/website" rel="nofollow"><img src="https://camo.githubusercontent.com/40f7a0ccb2daec4d628d56079f2576e4521d4350/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/3/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/4/website" rel="nofollow"><img src="https://camo.githubusercontent.com/4c616db62a03599716f9d127d2d0908631875646/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/4/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/5/website" rel="nofollow"><img src="https://camo.githubusercontent.com/26cf073d24726b6f5b02e6211ba98d44bfdfa7e8/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/5/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/6/website" rel="nofollow"><img src="https://camo.githubusercontent.com/60d5085475addf73e1baf4a6e70f2132280fff9a/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/6/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/7/website" rel="nofollow"><img src="https://camo.githubusercontent.com/3f7f0788028bf20cdbb3faab9368f64f2cc91b02/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/7/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/8/website" rel="nofollow"><img src="https://camo.githubusercontent.com/ed9e7bfbe7c925dcfbf140f95eb1621259dbdead/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/8/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/9/website" rel="nofollow"><img src="https://camo.githubusercontent.com/38cbdb177d36c3813e3debace87b2e705c72e759/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/9/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/10/website" rel="nofollow"><img src="https://camo.githubusercontent.com/467206730df61d2e0c528b62ec110fd13dc73855/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/10/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/11/website" rel="nofollow"><img src="https://camo.githubusercontent.com/c212ab930751b14b9e128c4270eac35d1b561a03/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/11/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/12/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1f88b3f9da39d28bfca91ae3340549c5335677ba/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/12/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/13/website" rel="nofollow"><img src="https://camo.githubusercontent.com/b958ed91ede50179b64c2f1a978d6a49bf78abec/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/13/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/14/website" rel="nofollow"><img src="https://camo.githubusercontent.com/67eead9a585f6e6aba2f859310b83e974cd68a8f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/14/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/15/website" rel="nofollow"><img src="https://camo.githubusercontent.com/cb6490b53fabb3a0ae6a791da521f3d1da4c8f48/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/15/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/16/website" rel="nofollow"><img src="https://camo.githubusercontent.com/51f98b9247099e5bf27eeef3835674c38b66c9a6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/16/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/17/website" rel="nofollow"><img src="https://camo.githubusercontent.com/33c379da6a6f44f6998185e77fc41141f053259d/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/17/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/18/website" rel="nofollow"><img src="https://camo.githubusercontent.com/0f3416e509f098c6b6aad858dc3423b4a52993e2/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/18/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/19/website" rel="nofollow"><img src="https://camo.githubusercontent.com/d42de4ca6e13ea9f4b3ea533350f62bcf01548f4/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f31392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/19/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/20/website" rel="nofollow"><img src="https://camo.githubusercontent.com/6d18b82e8111413e84eca474c0845a641de9575f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/20/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/21/website" rel="nofollow"><img src="https://camo.githubusercontent.com/80eda8519b5483ccfbda4bcb8f6618c93f1c64f6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/21/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/22/website" rel="nofollow"><img src="https://camo.githubusercontent.com/d36520263b1803edb2192549ba60d7451593d0f5/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/22/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/23/website" rel="nofollow"><img src="https://camo.githubusercontent.com/33bb1eaeef12cb2c14c9b81ec2dfc19bb101599c/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/23/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/24/website" rel="nofollow"><img src="https://camo.githubusercontent.com/097cf2ccae679f793ac05f0832293e8db9e84384/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/24/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/25/website" rel="nofollow"><img src="https://camo.githubusercontent.com/b0057b1838fc723427b96a29c9bc573a8a76c6f9/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/25/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/26/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1cf741ac13990dca9a1c39f64804ada19ec13c99/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/26/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/27/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1a60262791a5aff0aaf641abcbffa1b7085b5fe4/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/27/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/28/website" rel="nofollow"><img src="https://camo.githubusercontent.com/de9e1c13ef6baee995c045777bfc846beef5630b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/28/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/sponsor/29/website" rel="nofollow"><img src="https://camo.githubusercontent.com/0fb39896a872b192bb679c301b0cbf419eaa4a6f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f73706f6e736f722f32392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/sponsor/29/avatar.svg" style="max-width:100%;"></a></p>
<h2><a id="user-content-backers" class="anchor" aria-hidden="true" href="#backers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Backers</h2>
<p><a href="https://opencollective.com/cheerio#backer" rel="nofollow">Become a backer</a> to show your support for Cheerio and help us maintain and improve this open source project.</p>
<p><a href="https://opencollective.com/cheerio/backer/0/website" rel="nofollow"><img src="https://camo.githubusercontent.com/96f580669459b9b4f6b9a47529f81893e20d9ac0/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/0/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/1/website" rel="nofollow"><img src="https://camo.githubusercontent.com/5d7734f4309e6813d15c23b41046fabb00bc287e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/1/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/2/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1f5ae28b8adf4afe6a1126fd5bdb85fbe4043d25/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/2/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/3/website" rel="nofollow"><img src="https://camo.githubusercontent.com/c1c884e325cffca741b662a9a37796fd05e48e51/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/3/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/4/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1f8ff6247a604d9b0693d608e4fd2c29abb0cc02/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/4/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/5/website" rel="nofollow"><img src="https://camo.githubusercontent.com/22bc49e19575df34171ff479738f29189da34c0d/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/5/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/6/website" rel="nofollow"><img src="https://camo.githubusercontent.com/dc2766bc95c7548a72b12edcc032b05075e9c62d/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/6/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/7/website" rel="nofollow"><img src="https://camo.githubusercontent.com/58bf0f33e984f77d4d4f430f45a2d7a4a972a800/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/7/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/8/website" rel="nofollow"><img src="https://camo.githubusercontent.com/1b6c5c0263cef90816a008750a1c80923fb5ebc7/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/8/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/9/website" rel="nofollow"><img src="https://camo.githubusercontent.com/d2bbbed2a17198cc44747ce55cff3cea7e1e7b01/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/9/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/10/website" rel="nofollow"><img src="https://camo.githubusercontent.com/63592b37ed678024e69a29fac401e43199f6895f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/10/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/11/website" rel="nofollow"><img src="https://camo.githubusercontent.com/51d8f02cfd38a46ca8bcb238ec3cf21b617e09d6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/11/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/12/website" rel="nofollow"><img src="https://camo.githubusercontent.com/355da6409d6d8259f04e09a7620a5d30659c5b16/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/12/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/13/website" rel="nofollow"><img src="https://camo.githubusercontent.com/fb4ac2e4e00efe5eeefb9829062abf18dd066451/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/13/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/14/website" rel="nofollow"><img src="https://camo.githubusercontent.com/6af93ca6f6c964f8f911c6455d2f4d188c55aad8/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/14/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/15/website" rel="nofollow"><img src="https://camo.githubusercontent.com/4a404cf49c237c10e166aa90ccaaf55039aa2dff/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/15/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/16/website" rel="nofollow"><img src="https://camo.githubusercontent.com/b5c70c017456016c29960d1cc0f8f7155f7ef15c/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/16/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/17/website" rel="nofollow"><img src="https://camo.githubusercontent.com/b38c10a34e334e9850089fa5a57db885452c9499/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/17/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/18/website" rel="nofollow"><img src="https://camo.githubusercontent.com/582faa25e48c1d8a2ad295c21cab72ae797f037e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/18/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/19/website" rel="nofollow"><img src="https://camo.githubusercontent.com/69c984ebe4817f99e94711eca45739047a4e4351/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f31392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/19/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/20/website" rel="nofollow"><img src="https://camo.githubusercontent.com/5c6af308136aafe8126b8e8a90da7e7b53f1c2fb/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32302f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/20/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/21/website" rel="nofollow"><img src="https://camo.githubusercontent.com/6577d8772983c33705a70fcaa360d6dbeac53268/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32312f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/21/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/22/website" rel="nofollow"><img src="https://camo.githubusercontent.com/a3e39d0cdfe14f1021e5a00874fa566aad6ae44f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32322f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/22/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/23/website" rel="nofollow"><img src="https://camo.githubusercontent.com/a88e0c4a5fd51aaed85973150a1b0ea4f61fd7ba/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32332f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/23/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/24/website" rel="nofollow"><img src="https://camo.githubusercontent.com/fdbfca276106f44033c73c3ca7f627f99eef59be/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32342f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/24/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/25/website" rel="nofollow"><img src="https://camo.githubusercontent.com/ad9c445c71079fee316614e0e0e70efb82d8e4d3/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32352f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/25/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/26/website" rel="nofollow"><img src="https://camo.githubusercontent.com/62c2c531ac866c76dddfa3e053fff3e1803e54dd/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32362f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/26/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/27/website" rel="nofollow"><img src="https://camo.githubusercontent.com/45c2baea8bdf5f6966cacb99a6fefe5e4f916ad0/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32372f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/27/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/28/website" rel="nofollow"><img src="https://camo.githubusercontent.com/360915dcd2893a840225569dbe827cfe378c3a2f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32382f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/28/avatar.svg" style="max-width:100%;"></a>
<a href="https://opencollective.com/cheerio/backer/29/website" rel="nofollow"><img src="https://camo.githubusercontent.com/7d9ae9ab1cce6ac6211e09ab3a8dec706e74517b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6368656572696f2f6261636b65722f32392f6176617461722e737667" data-canonical-src="https://opencollective.com/cheerio/backer/29/avatar.svg" style="max-width:100%;"></a></p>
<h2><a id="user-content-api" class="anchor" aria-hidden="true" href="#api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>API</h2>
<h3><a id="user-content-markup-example-well-be-using" class="anchor" aria-hidden="true" href="#markup-example-well-be-using"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Markup example we'll be using:</h3>
<div class="highlight highlight-text-html-basic"><pre>&lt;<span class="pl-ent">ul</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>fruits<span class="pl-pds">"</span></span>&gt;
&lt;<span class="pl-ent">li</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>apple<span class="pl-pds">"</span></span>&gt;Apple&lt;/<span class="pl-ent">li</span>&gt;
&lt;<span class="pl-ent">li</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>orange<span class="pl-pds">"</span></span>&gt;Orange&lt;/<span class="pl-ent">li</span>&gt;
&lt;<span class="pl-ent">li</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>pear<span class="pl-pds">"</span></span>&gt;Pear&lt;/<span class="pl-ent">li</span>&gt;
&lt;/<span class="pl-ent">ul</span>&gt;</pre></div>
<p>This is the HTML markup we will be using in all of the API examples.</p>
<h3><a id="user-content-loading" class="anchor" aria-hidden="true" href="#loading"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Loading</h3>
<p>First you need to load in the HTML. This step in jQuery is implicit, since jQuery operates on the one, baked-in DOM. With Cheerio, we need to pass in the HTML document.</p>
<p>This is the <em>preferred</em> method:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">cheerio</span> <span class="pl-k">=</span> <span class="pl-c1">require</span>(<span class="pl-s"><span class="pl-pds">'</span>cheerio<span class="pl-pds">'</span></span>);
<span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(<span class="pl-s"><span class="pl-pds">'</span>&lt;ul id="fruits"&gt;...&lt;/ul&gt;<span class="pl-pds">'</span></span>);</pre></div>
<p>Optionally, you can also load in the HTML by passing the string as the context:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-c1">require</span>(<span class="pl-s"><span class="pl-pds">'</span>cheerio<span class="pl-pds">'</span></span>);
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>ul<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>&lt;ul id="fruits"&gt;...&lt;/ul&gt;<span class="pl-pds">'</span></span>);</pre></div>
<p>Or as the root:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-c1">require</span>(<span class="pl-s"><span class="pl-pds">'</span>cheerio<span class="pl-pds">'</span></span>);
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>li<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>ul<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>&lt;ul id="fruits"&gt;...&lt;/ul&gt;<span class="pl-pds">'</span></span>);</pre></div>
<p>If you need to modify parsing options for XML input, you may pass an extra
object to <code>.load()</code>:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(<span class="pl-s"><span class="pl-pds">'</span>&lt;ul id="fruits"&gt;...&lt;/ul&gt;<span class="pl-pds">'</span></span>, {
xml<span class="pl-k">:</span> {
normalizeWhitespace<span class="pl-k">:</span> <span class="pl-c1">true</span>,
}
});</pre></div>
<p>The options in the <code>xml</code> object are taken directly from <a href="https://github.com/fb55/htmlparser2/wiki/Parser-options">htmlparser2</a>, therefore any options that can be used in <code>htmlparser2</code> are valid in cheerio as well. The default options are:</p>
<div class="highlight highlight-source-js"><pre>{
withDomLvl1<span class="pl-k">:</span> <span class="pl-c1">true</span>,
normalizeWhitespace<span class="pl-k">:</span> <span class="pl-c1">false</span>,
xmlMode<span class="pl-k">:</span> <span class="pl-c1">true</span>,
decodeEntities<span class="pl-k">:</span> <span class="pl-c1">true</span>
}</pre></div>
<p>For a full list of options and their effects, see <a href="https://github.com/fb55/DomHandler">this</a> and
<a href="https://github.com/fb55/htmlparser2/wiki/Parser-options">htmlparser2's options</a>.</p>
<p>Some users may wish to parse markup with the <code>htmlparser2</code> library, and
traverse/manipulate the resulting structure with Cheerio. This may be the case
for those upgrading from pre-1.0 releases of Cheerio (which relied on
<code>htmlparser2</code>), for those dealing with invalid markup (because <code>htmlparser2</code> is
more forgiving), or for those operating in performance-critical situations
(because <code>htmlparser2</code> may be faster in some cases). Note that "more forgiving"
means <code>htmlparser2</code> has error-correcting mechanisms that aren't always a match
for the standards observed by web browsers. This behavior may be useful when
parsing non-HTML content.</p>
<p>To support these cases, <code>load</code> also accepts a <code>htmlparser2</code>-compatible data
structure as its first argument. Users may install <code>htmlparser2</code>, use it to
parse input, and pass the result to <code>load</code>:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Usage as of htmlparser2 version 3:</span>
<span class="pl-k">const</span> <span class="pl-c1">htmlparser2</span> <span class="pl-k">=</span> <span class="pl-c1">require</span>(<span class="pl-s"><span class="pl-pds">'</span>htmlparser2<span class="pl-pds">'</span></span>);
<span class="pl-k">const</span> <span class="pl-c1">dom</span> <span class="pl-k">=</span> <span class="pl-smi">htmlparser2</span>.<span class="pl-en">parseDOM</span>(<span class="pl-c1">document</span>, options);
<span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(dom);</pre></div>
<h3><a id="user-content-selectors" class="anchor" aria-hidden="true" href="#selectors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Selectors</h3>
<p>Cheerio's selector implementation is nearly identical to jQuery's, so the API is very similar.</p>
<h4><a id="user-content--selector-context-root-" class="anchor" aria-hidden="true" href="#-selector-context-root-"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>$( selector, [context], [root] )</h4>
<p><code>selector</code> searches within the <code>context</code> scope which searches within the <code>root</code> scope. <code>selector</code> and <code>context</code> can be a string expression, DOM Element, array of DOM elements, or cheerio object. <code>root</code> is typically the HTML document string.</p>
<p>This selector method is the starting point for traversing and manipulating the document. Like jQuery, it's the primary method for selecting elements in the document, but unlike jQuery it's built on top of the CSSSelect library, which implements most of the Sizzle selectors.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>.apple<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>#fruits<span class="pl-pds">'</span></span>).<span class="pl-c1">text</span>()
<span class="pl-c"><span class="pl-c">//</span>=&gt; Apple</span>
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>ul .pear<span class="pl-pds">'</span></span>).<span class="pl-en">attr</span>(<span class="pl-s"><span class="pl-pds">'</span>class<span class="pl-pds">'</span></span>)
<span class="pl-c"><span class="pl-c">//</span>=&gt; pear</span>
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>li[class=orange]<span class="pl-pds">'</span></span>).<span class="pl-en">html</span>()
<span class="pl-c"><span class="pl-c">//</span>=&gt; Orange</span></pre></div>
<h5><a id="user-content-xml-namespaces" class="anchor" aria-hidden="true" href="#xml-namespaces"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>XML Namespaces</h5>
<p>You can select with XML Namespaces but <a href="https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#attribute-selectors" rel="nofollow">due to the CSS specification</a>, the colon (<code>:</code>) needs to be escaped for the selector to be valid.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>[xml<span class="pl-cce">\\</span>:id="main"<span class="pl-pds">'</span></span>);</pre></div>
<h3><a id="user-content-rendering" class="anchor" aria-hidden="true" href="#rendering"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Rendering</h3>
<p>When you're ready to render the document, you can call the <code>html</code> method on the "root" selection:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-smi">$</span>.<span class="pl-en">root</span>().<span class="pl-en">html</span>()
<span class="pl-c"><span class="pl-c">//</span>=&gt; &lt;html&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;head&gt;&lt;/head&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;body&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;ul id="fruits"&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;li class="apple"&gt;Apple&lt;/li&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;li class="orange"&gt;Orange&lt;/li&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;li class="pear"&gt;Pear&lt;/li&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;/ul&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;/body&gt;</span>
<span class="pl-c"><span class="pl-c">//</span> &lt;/html&gt;</span></pre></div>
<p>If you want to render the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML" rel="nofollow"><code>outerHTML</code></a> of a selection, you can use the <code>html</code> utility functon:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-smi">cheerio</span>.<span class="pl-en">html</span>(<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>.pear<span class="pl-pds">'</span></span>))
<span class="pl-c"><span class="pl-c">//</span>=&gt; &lt;li class="pear"&gt;Pear&lt;/li&gt;</span></pre></div>
<p>By default, <code>html</code> will leave some tags open. Sometimes you may instead want to render a valid XML document. For example, you might parse the following XML snippet:</p>
<div class="highlight highlight-text-xml"><pre>const $ = cheerio.load('&lt;<span class="pl-ent">media</span><span class="pl-ent">:</span><span class="pl-ent">thumbnail</span> <span class="pl-e">url</span>=<span class="pl-s"><span class="pl-pds">"</span>http://www.foo.com/keyframe.jpg<span class="pl-pds">"</span></span> <span class="pl-e">width</span>=<span class="pl-s"><span class="pl-pds">"</span>75<span class="pl-pds">"</span></span> <span class="pl-e">height</span>=<span class="pl-s"><span class="pl-pds">"</span>50<span class="pl-pds">"</span></span> <span class="pl-e">time</span>=<span class="pl-s"><span class="pl-pds">"</span>12:05:01.123<span class="pl-pds">"</span></span>/&gt;');</pre></div>
<p>... and later want to render to XML. To do this, you can use the 'xml' utility function:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-smi">$</span>.<span class="pl-en">xml</span>()
<span class="pl-c"><span class="pl-c">//</span>=&gt; &lt;media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123"/&gt;</span></pre></div>
<p>You may also render the text content of a Cheerio object using the <code>text</code> static method:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(<span class="pl-s"><span class="pl-pds">'</span>This is &lt;em&gt;content&lt;/em&gt;.<span class="pl-pds">'</span></span>)
<span class="pl-smi">cheerio</span>.<span class="pl-c1">text</span>(<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>body<span class="pl-pds">'</span></span>))
<span class="pl-c"><span class="pl-c">//</span>=&gt; This is content.</span></pre></div>
<h3><a id="user-content-plugins" class="anchor" aria-hidden="true" href="#plugins"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Plugins</h3>
<p>Once you have loaded a document, you may extend the prototype or the equivalent <code>fn</code> property with custom plugin methods:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">$</span> <span class="pl-k">=</span> <span class="pl-smi">cheerio</span>.<span class="pl-c1">load</span>(<span class="pl-s"><span class="pl-pds">'</span>&lt;html&gt;&lt;body&gt;Hello, &lt;b&gt;world&lt;/b&gt;!&lt;/body&gt;&lt;/html&gt;<span class="pl-pds">'</span></span>);
<span class="pl-smi">$</span>.<span class="pl-c1">prototype</span>.<span class="pl-en">logHtml</span> <span class="pl-k">=</span> <span class="pl-k">function</span>() {
<span class="pl-en">console</span>.<span class="pl-c1">log</span>(<span class="pl-c1">this</span>.<span class="pl-en">html</span>());
};
<span class="pl-en">$</span>(<span class="pl-s"><span class="pl-pds">'</span>body<span class="pl-pds">'</span></span>).<span class="pl-en">logHtml</span>(); <span class="pl-c"><span class="pl-c">//</span> logs "Hello, &lt;b&gt;world&lt;/b&gt;!" to the console</span></pre></div>
<h3><a id="user-content-the-dom-node-object" class="anchor" aria-hidden="true" href="#the-dom-node-object"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>The "DOM Node" object</h3>
<p>Cheerio collections are made up of objects that bear some resemblence to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Node" rel="nofollow">browser-based DOM nodes</a>. You can expect them to define the following properties:</p>
<ul>
<li><code>tagName</code></li>
<li><code>parentNode</code></li>
<li><code>previousSibling</code></li>
<li><code>nextSibling</code></li>
<li><code>nodeValue</code></li>
<li><code>firstChild</code></li>
<li><code>childNodes</code></li>
<li><code>lastChild</code></li>
</ul>
<h2><a id="user-content-screencasts" class="anchor" aria-hidden="true" href="#screencasts"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Screencasts</h2>
<p><a href="http://vimeo.com/31950192" rel="nofollow">http://vimeo.com/31950192</a></p>
<blockquote>
<p>This video tutorial is a follow-up to Nettut's "How to Scrape Web Pages with Node.js and jQuery", using cheerio instead of JSDOM + jQuery. This video shows how easy it is to use cheerio and how much faster cheerio is than JSDOM + jQuery.</p>
</blockquote>
<h2><a id="user-content-contributors" class="anchor" aria-hidden="true" href="#contributors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Contributors</h2>
<p>These are some of the contributors that have made cheerio possible:</p>
<pre><code>project : cheerio
repo age : 2 years, 6 months
active : 285 days
commits : 762
files : 36
authors :
293 Matt Mueller 38.5%
133 Matthew Mueller 17.5%
92 Mike Pennisi 12.1%
54 David Chambers 7.1%
30 kpdecker 3.9%
19 Felix Böhm 2.5%
17 fb55 2.2%
15 Siddharth Mahendraker 2.0%
11 Adam Bretz 1.4%
8 Nazar Leush 1.0%
7 ironchefpython 0.9%
6 Jarno Leppänen 0.8%
5 Ben Sheldon 0.7%
5 Jos Shepherd 0.7%
5 Ryan Schmukler 0.7%
5 Steven Vachon 0.7%
4 Maciej Adwent 0.5%
4 Amir Abu Shareb 0.5%
3 jeremy.dentel@brandingbrand.com 0.4%
3 Andi Neck 0.4%
2 steve 0.3%
2 alexbardas 0.3%
2 finspin 0.3%
2 Ali Farhadi 0.3%
2 Chris Khoo 0.3%
2 Rob Ashton 0.3%
2 Thomas Heymann 0.3%
2 Jaro Spisak 0.3%
2 Dan Dascalescu 0.3%
2 Torstein Thune 0.3%
2 Wayne Larsen 0.3%
1 Timm Preetz 0.1%
1 Xavi 0.1%
1 Alex Shaindlin 0.1%
1 mattym 0.1%
1 Felix Böhm 0.1%
1 Farid Neshat 0.1%
1 Dmitry Mazuro 0.1%
1 Jeremy Hubble 0.1%
1 nevermind 0.1%
1 Manuel Alabor 0.1%
1 Matt Liegey 0.1%
1 Chris O'Hara 0.1%
1 Michael Holroyd 0.1%
1 Michiel De Mey 0.1%
1 Ben Atkin 0.1%
1 Rich Trott 0.1%
1 Rob "Hurricane" Ashton 0.1%
1 Robin Gloster 0.1%
1 Simon Boudrias 0.1%
1 Sindre Sorhus 0.1%
1 xiaohwan 0.1%
</code></pre>
<h2><a id="user-content-cheerio-in-the-real-world" class="anchor" aria-hidden="true" href="#cheerio-in-the-real-world"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Cheerio in the real world</h2>
<p>Are you using cheerio in production? Add it to the <a href="https://github.com/cheeriojs/cheerio/wiki/Cheerio-in-Production">wiki</a>!</p>
<h2><a id="user-content-testing" class="anchor" aria-hidden="true" href="#testing"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Testing</h2>
<p>To run the test suite, download the repository, then within the cheerio directory, run:</p>
<div class="highlight highlight-source-shell"><pre>make setup
make <span class="pl-c1">test</span></pre></div>
<p>This will download the development packages and run the test suite.</p>
<h2><a id="user-content-special-thanks" class="anchor" aria-hidden="true" href="#special-thanks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Special Thanks</h2>
<p>This library stands on the shoulders of some incredible developers. A special thanks to:</p>
<p><strong>• @FB55 for node-htmlparser2 &amp; CSSSelect:</strong>
Felix has a knack for writing speedy parsing engines. He completely re-wrote both @tautologistic's <code>node-htmlparser</code> and @harry's <code>node-soupselect</code> from the ground up, making both of them much faster and more flexible. Cheerio would not be possible without his foundational work</p>
<p><strong>• @jQuery team for jQuery:</strong>
The core API is the best of its class and despite dealing with all the browser inconsistencies the code base is extremely clean and easy to follow. Much of cheerio's implementation and documentation is from jQuery. Thanks guys.</p>
<p><strong>• @visionmedia:</strong>
The style, the structure, the open-source"-ness" of this library comes from studying TJ's style and using many of his libraries. This dude consistently pumps out high-quality libraries and has always been more than willing to help or answer questions. You rock TJ.</p>
<h2><a id="user-content-license" class="anchor" aria-hidden="true" href="#license"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>License</h2>
<p>MIT</p>
</article>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<div class="footer container-lg width-full px-3" role="contentinfo">
<div class="position-relative d-flex flex-justify-between pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light ">
<ul class="list-style-none d-flex flex-wrap ">
<li class="mr-3">&copy; 2019 <span title="0.31716s from unicorn-67474f6b57-8f7zd">GitHub</span>, Inc.</li>
<li class="mr-3"><a data-ga-click="Footer, go to terms, text:terms" href="https://github.com/site/terms">Terms</a></li>
<li class="mr-3"><a data-ga-click="Footer, go to privacy, text:privacy" href="https://github.com/site/privacy">Privacy</a></li>
<li class="mr-3"><a data-ga-click="Footer, go to security, text:security" href="https://github.com/security">Security</a></li>
<li class="mr-3"><a href="https://githubstatus.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
<li><a data-ga-click="Footer, go to help, text:help" href="https://help.github.com">Help</a></li>
</ul>
<a aria-label="Homepage" title="GitHub" class="footer-octicon d-none d-lg-block mx-lg-4" href="https://github.com">
<svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
<ul class="list-style-none d-flex flex-wrap ">
<li class="mr-3"><a data-ga-click="Footer, go to contact, text:contact" href="https://github.com/contact">Contact GitHub</a></li>
<li class="mr-3"><a href="https://github.com/pricing" data-ga-click="Footer, go to Pricing, text:Pricing">Pricing</a></li>
<li class="mr-3"><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
<li class="mr-3"><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
<li class="mr-3"><a href="https://github.blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
<li><a data-ga-click="Footer, go to about, text:about" href="https://github.com/about">About</a></li>
</ul>
</div>
<div class="d-flex flex-justify-center pb-6">
<span class="f6 text-gray-light"></span>
</div>
</div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error">
<svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 000 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 00.01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg>
<button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
<svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>
</button>
You can’t perform that action at this time.
</div>
<script crossorigin="anonymous" integrity="sha512-/0/hG6mF2aQ0/ZE53aX4FE7ZUbdrdkwhnK4gdkvnbzXolajofHxa3PGB6QOf/csCOvP3HpJusxuKNmcb7tJwtg==" type="application/javascript" src="https://github.githubassets.com/assets/compat-bootstrap-f8243bfc.js"></script>
<script crossorigin="anonymous" integrity="sha512-4JsuiTlMAprr6vF8YB0G8g7Ss7s5+irdU7eFQpEMW60R1NDb61bo6shomBSAcepi26csEdoMpSTXRPyLTLwJpw==" type="application/javascript" src="https://github.githubassets.com/assets/frameworks-452b2867.js"></script>
<script crossorigin="anonymous" async="async" integrity="sha512-q850LlHrJbHiWzYuzYR6/LJaJb8QZK4z3Ac5SPmI/wVFq24YIw2RopksyDaqSJAOMLGer0yPm+BOeBzFOWtI6Q==" type="application/javascript" src="https://github.githubassets.com/assets/github-bootstrap-45a6c992.js"></script>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden
>
<svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 000 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 00.01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg>
<span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
<template id="site-details-dialog">
<details class="details-reset details-overlay details-overlay-dark lh-default text-gray-dark hx_rsm" open>
<summary role="button" aria-label="Close dialog"></summary>
<details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal">
<button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog>
<svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>
</button>
<div class="octocat-spinner my-6 js-details-dialog-spinner"></div>
</details-dialog>
</details>
</template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0">
<div class="Popover-message Popover-message--bottom-left Popover-message--large Box box-shadow-large" style="width:360px;">
</div>
</div>
<div aria-live="polite" class="js-global-screen-reader-notice sr-only"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment