@crawlee/utils 4.0.0-beta.227 → 4.0.0-beta.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internals/sitemap.js +7 -3
- package/package.json +4 -4
package/internals/sitemap.js
CHANGED
|
@@ -106,16 +106,20 @@ class SitemapXmlParser extends Transform {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
#onText(text) {
|
|
109
|
+
text = text.trim();
|
|
110
|
+
// Whitespace around a CDATA section arrives as separate text events.
|
|
111
|
+
if (text === '') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
109
114
|
if (this.#currentTag === 'loc') {
|
|
110
115
|
if (this.#rootTagName === 'sitemapindex') {
|
|
111
|
-
this.push({ type: 'sitemapUrl', url: text
|
|
116
|
+
this.push({ type: 'sitemapUrl', url: text });
|
|
112
117
|
}
|
|
113
118
|
if (this.#rootTagName === 'urlset') {
|
|
114
119
|
this.#url ??= {};
|
|
115
|
-
this.#url.loc = text
|
|
120
|
+
this.#url.loc = text;
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
|
-
text = text.trim();
|
|
119
123
|
if (this.#currentTag === 'lastmod') {
|
|
120
124
|
const lastmod = new Date(text);
|
|
121
125
|
if (!Number.isNaN(lastmod.getTime())) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/utils",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.229",
|
|
4
4
|
"description": "A set of shared utilities that can be used by crawlers",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.13.0"
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apify/validations": "^1.1.0",
|
|
46
|
-
"@crawlee/http-client": "4.0.0-beta.
|
|
47
|
-
"@crawlee/types": "4.0.0-beta.
|
|
46
|
+
"@crawlee/http-client": "4.0.0-beta.229",
|
|
47
|
+
"@crawlee/types": "4.0.0-beta.229",
|
|
48
48
|
"@types/sax": "^1.2.7",
|
|
49
49
|
"cheerio": "^1.0.0",
|
|
50
50
|
"domhandler": "^6.0.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "4f498def4c4c52d48ef1c687fb890bb4d8baf0d7"
|
|
67
67
|
}
|