Skip to content

Commit

Permalink
feat: console output of non-200 http codes
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Apr 20, 2020
1 parent 59449b1 commit 009dedb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scrap-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ module.exports = async (baseUrl, options = {}) => {
// The result contains options, links, cookies and etc.
const result = await crawl();

if(result.response.status != 200) {
console.error(`${color.red}Code: ${result.response.status}${color.reset}`);
}

result.result.mixed_content_url = mixedContentUrl;
// You can access the page object after requests
result.content = await page.content();
Expand Down

0 comments on commit 009dedb

Please sign in to comment.