Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function verifyLinks(url) {
  2. request(url, function (error, response, body) {
  3. if (!error) {
  4. console.log(response.statusCode);
  5. var $ = cheerio.load(body);
  6. links = $('a');
  7. $(links).each(function (i, link) {
  8. verifyLinks($(link).attr('href'));
  9. });
  10. } else {
  11. console.log("Error occurred: " + error);
  12. }
  13. });
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement