Skip to content

Commit

Permalink
Toggle waitUntil option for robots and sitemap scans
Browse files Browse the repository at this point in the history
  • Loading branch information
akuny committed May 8, 2024
1 parent f3ec2cb commit 7cd89fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libs/core-scanner/src/pages/robots-txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const createRobotsTxtScanner = (logger: Logger, input: CoreInputDto) => {
// go to the robots page from the target url
const robotsUrl = new URL(url);
robotsUrl.pathname = 'robots.txt';
const robotsResponse = await robotsPage.goto(robotsUrl.toString());
const robotsResponse = await robotsPage.goto(robotsUrl.toString(), {
waitUntil: 'networkidle0',
});
// extract the html page source
const robotsText = await robotsResponse.text();

Expand Down
4 changes: 3 additions & 1 deletion libs/core-scanner/src/pages/sitemap-xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const createSitemapXmlScanner = (
const sitemapUrl = new URL(url);
sitemapUrl.pathname = 'sitemap.xml';
logger.info('Going to sitemap.xml...');
const sitemapResponse = await sitemapPage.goto(sitemapUrl.toString());
const sitemapResponse = await sitemapPage.goto(sitemapUrl.toString(), {
waitUntil: 'networkidle0',
});
logger.info('Got sitemap.xml!');
// extract the html page source
const sitemapText = await sitemapResponse.text();
Expand Down

0 comments on commit 7cd89fb

Please sign in to comment.