clean-web-scraper 3.4.0 → 3.4.1
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/package.json +1 -1
- package/src/WebScraper.js +5 -1
package/package.json
CHANGED
package/src/WebScraper.js
CHANGED
|
@@ -118,13 +118,17 @@ class WebScraper
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
this.visited.add( url );
|
|
121
|
+
if ( !this.isValidFileType( url ) )
|
|
122
|
+
{
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
121
125
|
try
|
|
122
126
|
{
|
|
123
127
|
const data = await this.caller( url );
|
|
124
128
|
const dom = new JSDOM( data, { url });
|
|
125
129
|
const { document } = dom.window;
|
|
126
130
|
|
|
127
|
-
if ( !this.isExcluded( url )
|
|
131
|
+
if ( !this.isExcluded( url ) )
|
|
128
132
|
{
|
|
129
133
|
const reader = new Readability( document, { charThreshold: 500, nbTopCandidates: 20 });
|
|
130
134
|
const article = reader.parse();
|