javascript - node.js parse a page and catch external frontend js errors -


is possible parse external page http://example.com has js errors (for example '$ not defined'), catch these errors , print them via console.log()?

yes, possible. need download page , render in headless browser such phantomjs.

someone has done already: http://npmjs.com/package/phantom-check

$ phantom-check http://example.com phantom checking http://example.com  [info] [phantom] starting... [info] [phantom] running suite: 2 steps [debug] [phantom] opening url: http://example.com/, http [debug] [phantom] navigation requested: url=http://example.com/, type=other, willnavigate=true, ismainframe=true [debug] [phantom] url changed "http://example.com/" [debug] [phantom] injected casper client-side utilities  page http://example.com has no errors 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -