Open banner-prog opened 3 years ago
Can you give specific examples?
Like, if I want to scan for broken links of facebook.com and github.com, I am meant to use the option includedKeywords
. However, even if I use that, the tool will scan and give results of broken links such as example.com or instagram.com
please give exact runnable code/command that triggers this bug - it needs to be done as the first step of resolving this bug
Here is the code
var { SiteChecker } = require("broken-link-checker");
var URL = "https://www.github.com"
const siteChecker = new SiteChecker(
{
excludeInternalLinks: true,
excludeExternalLinks: false,
filterLevel: 1,
acceptedSchemes: ["http", "https"],
excludedKeywords: ["linkedin.com"],
includedKeywords: ["facebook.com","instagram.com"],
},
{
"error": (error) => {
console.error(error);
},
"link": (result, customData) => {
if(result.broken) {
if(result.http.response && ![undefined, 200].includes(result.http.response.statusCode)) {
console.log(`${result.base.original} => ${result.url.original}`);
}
}
},
"end": () => {
console.log("COMPLETED!");
}
}
);
siteChecker.enqueue(URL);
The option
includedKeywords
does not work. The tool will scan for all links even when you want to scan links with only specific keywords.