Skip to content

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.

Bugfix in Apify.utils.htmlToText(), bumped package.json version

Jan Curn35afb55c00cc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5063ea0f..bbe8567be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-0.10.1 / 2018-12-30
+0.10.2 / 2018-12-30
===================
- Added `Apify.utils.htmlToText()` function to convert HTML to text and removed unncessary `html-to-text` dependency.
The new function is now used in `Apify.utils.social.parseHandlesFromHtml()`.
diff --git a/package.json b/package.json
index 2a0dd8a52..2777f36af 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "apify",
- "version": "0.10.1",
+ "version": "0.10.2",
"description": "The scalable web crawling and scraping library for JavaScript. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
"engines": {
"node": ">=8.0.0"
diff --git a/src/utils.js b/src/utils.js
index c8805a2ea..57e16523c 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -523,7 +523,7 @@ export const htmlToText = (html) => {
let text = '';
const process = (elems) => {
- const len = elems.length;
+ const len = elems ? elems.length : 0;
for (let i = 0; i < len; i++) {
const elem = elems[i];
if (elem.type === 'text') {