test
This commit is contained in:
parent
7b4f2b8f91
commit
7a126c4b10
1 changed files with 3 additions and 0 deletions
3
site.js
3
site.js
|
@ -16,7 +16,9 @@ async function urlCollector(url, path, file, useLimit) {
|
|||
try {
|
||||
data = await fetch(url);
|
||||
data = await data.text();
|
||||
console.log(`User ${url} was fetched`);
|
||||
} catch (err) {
|
||||
console.log(`User ${url} did not fetch`);
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -24,6 +26,7 @@ async function urlCollector(url, path, file, useLimit) {
|
|||
let links = body('a');
|
||||
let urls = [];
|
||||
links.each(function(i, link) {
|
||||
console.log(`User ${url} has ${i} pages calculated`);
|
||||
if (useLimit && urls.length >= pageLimit * 40) return;
|
||||
|
||||
let h = body(link).attr('href');
|
||||
|
|
Loading…
Reference in a new issue