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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clean-web-scraper",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "start": "node main.js",
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 ) && this.isValidFileType( 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();