@crawlee/utils 3.17.1-beta.32 → 3.17.1-beta.33
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 +8 -3
- package/package.json +3 -3
package/internals/sitemap.js
CHANGED
|
@@ -134,8 +134,10 @@ class SitemapXmlParser extends node_stream_1.Transform {
|
|
|
134
134
|
if (name === 'loc' || name === 'lastmod' || name === 'priority' || name === 'changefreq') {
|
|
135
135
|
this.currentTag = undefined;
|
|
136
136
|
}
|
|
137
|
-
if (name === 'url'
|
|
138
|
-
|
|
137
|
+
if (name === 'url') {
|
|
138
|
+
if (this.url.loc !== undefined) {
|
|
139
|
+
this.push({ type: 'url', ...this.url, loc: this.url.loc });
|
|
140
|
+
}
|
|
139
141
|
this.url = {};
|
|
140
142
|
}
|
|
141
143
|
}
|
|
@@ -151,7 +153,10 @@ class SitemapXmlParser extends node_stream_1.Transform {
|
|
|
151
153
|
}
|
|
152
154
|
text = text.trim();
|
|
153
155
|
if (this.currentTag === 'lastmod') {
|
|
154
|
-
|
|
156
|
+
const lastmod = new Date(text);
|
|
157
|
+
if (!Number.isNaN(lastmod.getTime())) {
|
|
158
|
+
this.url.lastmod = lastmod;
|
|
159
|
+
}
|
|
155
160
|
}
|
|
156
161
|
if (this.currentTag === 'priority') {
|
|
157
162
|
this.url.priority = Number(text);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/utils",
|
|
3
|
-
"version": "3.17.1-beta.
|
|
3
|
+
"version": "3.17.1-beta.33",
|
|
4
4
|
"description": "A set of shared utilities that can be used by crawlers",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.0.0"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apify/log": "^2.4.0",
|
|
51
51
|
"@apify/ps-tree": "^1.2.0",
|
|
52
|
-
"@crawlee/types": "3.17.1-beta.
|
|
52
|
+
"@crawlee/types": "3.17.1-beta.33",
|
|
53
53
|
"@types/sax": "^1.2.7",
|
|
54
54
|
"cheerio": "1.0.0-rc.12",
|
|
55
55
|
"file-type": "^21.3.1",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e37f7745503379dde5dcdcb75edc7dbbe72dced1"
|
|
74
74
|
}
|