clean-web-scraper 4.0.7 → 4.1.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/main.js +3 -1
- package/package.json +1 -1
package/main.js
CHANGED
@@ -110,11 +110,12 @@ class WebScraper
|
|
110
110
|
|
111
111
|
async processUrl ( url, depth, queue )
|
112
112
|
{
|
113
|
-
console.log( `Processing URL: ${url}
|
113
|
+
console.log( `Processing URL: ${url}. Total visited: ${this.visited.size}. Total processed: ${this.allProcessedContent.length}.` );
|
114
114
|
if ( this.hasReachedMax( depth ) )
|
115
115
|
{
|
116
116
|
return;
|
117
117
|
}
|
118
|
+
let originalUrl = url;
|
118
119
|
if ( this.removeURLFragment )
|
119
120
|
{
|
120
121
|
url = url.split( "#" )[0];
|
@@ -125,6 +126,7 @@ class WebScraper
|
|
125
126
|
return;
|
126
127
|
}
|
127
128
|
this.visited.add( url );
|
129
|
+
this.visited.add( originalUrl );
|
128
130
|
if ( !this.isValidFileType( url ) || !this.isValidDomain( url ) )
|
129
131
|
{
|
130
132
|
return;
|