Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Added a TODO to Apify.utils.htmlToText()
Jan Curnb3fd463a656e
diff --git a/src/utils.js b/src/utils.jsindex f1d977737..e3ec43aa1 100644--- a/src/utils.js+++ b/src/utils.js@@ -535,6 +535,9 @@ const BLOCK_TAGS_REGEX = /^(p|h1|h2|h3|h4|h5|h6|ol|ul|li|pre|address|blockquote|const htmlToText = (html) => {if (!html) return '';+ // TODO: Add support for "html" being a Cheerio element, otherwise the only way+ // to use it is e.g. htmlToText($('p').html())) which is inefficient+/** @type {Cheerio} */const $ = typeof html === 'function' ? html : cheerio.load(html, { decodeEntities: true });let text = '';