[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEKDGP35N7BD487RV8KAR2":3,"skill-same:01M6EEKDGP35N7BD487RV8KAR2":51},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EEKDGP35N7BD487RV8KAR2","cheerio",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fcheerio\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# Cheerio\n\n## Overview\n\nCheerio is a fast, lightweight HTML\u002FXML parser for Node.js that implements a jQuery-like API. Unlike Puppeteer, it does not run a browser — it parses raw HTML strings, making it 100x faster and ideal for scraping server-rendered pages, parsing HTML files, and transforming HTML content. Pair it with `fetch` or `axios` for web scraping, or use it standalone for HTML processing.\n\n## Instructions\n\n### Step 1: Installation\n\n```bash\nnpm install cheerio\n```\n\n### Step 2: Parse HTML and Extract Data\n\n```javascript\n\u002F\u002F parse_html.js — Load HTML and extract structured data with CSS selectors\nimport * as cheerio from 'cheerio'\n\nconst html = `\n\u003Chtml>\n  \u003Cbody>\n    \u003Ch1>Products\u003C\u002Fh1>\n    \u003Cdiv class=\"product\" data-id=\"1\">\n      \u003Ch2>Widget Pro\u003C\u002Fh2>\n      \u003Cspan class=\"price\">$29.99\u003C\u002Fspan>\n      \u003Ca href=\"\u002Fproducts\u002Fwidget-pro\">Details\u003C\u002Fa>\n    \u003C\u002Fdiv>\n    \u003Cdiv class=\"product\" data-id=\"2\">\n      \u003Ch2>Gadget Max\u003C\u002Fh2>\n      \u003Cspan class=\"price\">$49.99\u003C\u002Fspan>\n      \u003Ca href=\"\u002Fproducts\u002Fgadget-max\">Details\u003C\u002Fa>\n    \u003C\u002Fdiv>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>`\n\nconst $ = cheerio.load(html)\n\n\u002F\u002F Extract all products\nconst products = []\n$('.product').each((i, el) => {\n  products.push({\n    id: $(el).attr('data-id'),\n    title: $(el).find('h2').text().trim(),\n    price: $(el).find('.price').text().trim(),\n    link: $(el).find('a').attr('href'),\n  })\n})\n\nconsole.log(products)\n\u002F\u002F [{ id: '1', title: 'Widget Pro', price: '$29.99', link: '\u002Fproducts\u002Fwidget-pro' }, ...]\n```\n\n### Step 3: Web Scraping with Fetch\n\n```javascript\n\u002F\u002F scrape_site.js — Fetch a page and extract data\nimport * as cheerio from 'cheerio'\n\nasync function scrape(url) {\n  const response = await fetch(url)\n  const html = await response.text()\n  const $ = cheerio.load(html)\n\n  \u002F\u002F Extract all links\n  const links = []\n  $('a[href]').each((i, el) => {\n    links.push({\n      text: $(el).text().trim(),\n      href: $(el).attr('href'),\n    })\n  })\n\n  \u002F\u002F Extract meta tags\n  const meta = {\n    title: $('title').text(),\n    description: $('meta[name=\"description\"]').attr('content'),\n    ogImage: $('meta[property=\"og:image\"]').attr('content'),\n  }\n\n  return { links, meta }\n}\n```\n\n### Step 4: Advanced Selectors and Traversal\n\n```javascript\n\u002F\u002F selectors.js — Complex CSS selectors and DOM traversal\nconst $ = cheerio.load(html)\n\n\u002F\u002F Attribute selectors\n$('a[href^=\"https\"]')           \u002F\u002F links starting with https\n$('img[src$=\".png\"]')           \u002F\u002F PNG images\n$('div[class*=\"product\"]')      \u002F\u002F divs with \"product\" in class\n\n\u002F\u002F Traversal\n$('.product').first()            \u002F\u002F first product\n$('.product').last()             \u002F\u002F last product\n$('.product').eq(2)              \u002F\u002F third product (0-indexed)\n$('.price').parent()             \u002F\u002F parent of each .price element\n$('.product').children('h2')     \u002F\u002F direct h2 children\n$('.product').find('.price')     \u002F\u002F descendants matching .price\n$('.product').next()             \u002F\u002F next sibling\n$('.product').prev()             \u002F\u002F previous sibling\n\n\u002F\u002F Filtering\n$('.product').filter((i, el) => {\n  const price = parseFloat($(el).find('.price').text().replace('$', ''))\n  return price \u003C 50\n})\n\n\u002F\u002F Text and HTML\n$('.product').first().text()     \u002F\u002F all text content, flattened\n$('.product').first().html()     \u002F\u002F inner HTML\n```\n\n### Step 5: Table Extraction\n\n```javascript\n\u002F\u002F extract_table.js — Parse HTML tables into structured data\nfunction extractTable($, tableSelector) {\n  \u002F**\n   * Convert an HTML table to an array of objects using headers as keys.\n   * Args:\n   *   $: Cheerio instance\n   *   tableSelector: CSS selector for the table element\n   *\u002F\n  const headers = []\n  $(`${tableSelector} thead th`).each((i, el) => {\n    headers.push($(el).text().trim())\n  })\n\n  const rows = []\n  $(`${tableSelector} tbody tr`).each((i, tr) => {\n    const row = {}\n    $(tr).find('td').each((j, td) => {\n      row[headers[j]] = $(td).text().trim()\n    })\n    rows.push(row)\n  })\n  return rows\n}\n\n\u002F\u002F Usage\nconst tableData = extractTable($, '#pricing-table')\n\u002F\u002F [{ Plan: 'Free', Price: '$0', Users: '1' }, { Plan: 'Pro', Price: '$29', Users: '10' }]\n```\n\n### Step 6: HTML Transformation\n\n```javascript\n\u002F\u002F transform.js — Modify HTML content\nconst $ = cheerio.load(html)\n\n\u002F\u002F Add class\n$('.product').addClass('featured')\n\n\u002F\u002F Remove elements\n$('.ad-banner').remove()\n\n\u002F\u002F Replace content\n$('h1').text('Updated Title')\n\n\u002F\u002F Wrap elements\n$('.product').wrap('\u003Csection class=\"product-section\">\u003C\u002Fsection>')\n\n\u002F\u002F Add attributes\n$('a').attr('target', '_blank')\n$('img').attr('loading', 'lazy')\n\n\u002F\u002F Get modified HTML\nconst modifiedHtml = $.html()\n```\n\n## Examples\n\n### Example 1: Build a price monitoring scraper\n**User prompt:** \"Scrape product prices from 5 competitor websites daily and save to a CSV. The sites are server-rendered (no JavaScript needed).\"\n\nThe agent will:\n1. Use `fetch` + cheerio for each site (no browser overhead).\n2. Write site-specific selectors for product name, price, and availability.\n3. Parse prices into numbers, normalize currency.\n4. Append results to a CSV with timestamps.\n5. Set up as a cron job for daily execution.\n\n### Example 2: Extract and clean article content from HTML\n**User prompt:** \"I have 1,000 saved HTML pages from a blog. Extract just the article title, author, date, and body text from each, ignoring navigation, ads, and footers.\"\n\nThe agent will:\n1. Read each HTML file, load with cheerio.\n2. Extract content using article-specific selectors (`article`, `.post-content`, etc.).\n3. Strip HTML tags from body, normalize whitespace.\n4. Output structured JSON with title, author, date, and clean text.\n\n## Guidelines\n\n- Use cheerio for server-rendered pages (where the HTML contains the data you need). For SPAs or JavaScript-rendered content, use Puppeteer instead.\n- Cheerio does not execute JavaScript, fetch external resources, or render CSS — it only parses the HTML string you give it.\n- Always call `.trim()` on extracted text — HTML often contains whitespace, newlines, and indentation that clutters results.\n- Use `.attr('href')` and `.attr('src')` to get link\u002Fimage URLs. Remember these may be relative — resolve them against the base URL.\n- For large-scale scraping, cheerio is 100x faster than Puppeteer and uses negligible memory. It can process thousands of pages per second.\n- Combine cheerio with `fetch` or `axios` for scraping, and add delays between requests to avoid overwhelming target servers.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fcheerio",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill cheerio",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill cheerio",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill cheerio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fcheerio\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fblock-types.md","REFERENCE","参考文档",3021,"https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002FWORM_V2_SOVEREIGN\u002Fblob\u002Fmain\u002Fcore\u002Fhermes-agent\u002Fskills\u002Fproductivity\u002Fnotion\u002Freferences\u002Fblock-types.md",[52,66,76,85,91,98],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":62,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[57],{"categoryNo":58,"categoryName":59,"taxonomyType":60,"taxonomyTypeDesc":61},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[63,64,65],"model","model hierarchy","model hierarchy skill",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":72,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[71],{"categoryNo":58,"categoryName":59,"taxonomyType":60,"taxonomyTypeDesc":61},[73,74,75],"MCP","zoom","zoom mcp",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[82,83,84,74],"sdk","zoom apps sdk","apps",{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":97,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[96],{"categoryNo":58,"categoryName":59,"taxonomyType":60,"taxonomyTypeDesc":61},[93],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[100]]