Revisions
-
mortenjust revised this gist
Mar 18, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ /* https://github.com/tmpvar/jsdom/tree/master/lib $ curl http://www.timeanddate.com/norsk/kalender.html (...) <div id=po1 class=po></div> -
torgeir revised this gist
Mar 8, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,5 @@ jsdom.env(url, [ 'http://code.jquery.com/jquery-1.7.min.js' ], done); function done (errors, window) { var year = window.$('h1').text().replace(/[^\d]/g, ''); console.log('This is', year); window.close(); } -
torgeir created this gist
Dec 2, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ /* $ curl http://www.timeanddate.com/norsk/kalender.html (...) <div id=po1 class=po></div> <h1>Kalender for år 2011</h1> <table class="ct" border="0" cellpadding="4" cellspacing="0" align="center"> (...) $ node scrape.js This is 2011 */ var jsdom = require("jsdom"); var url = 'http://www.timeanddate.com/norsk/kalender.html'; jsdom.env(url, [ 'http://code.jquery.com/jquery-1.7.min.js' ], done); function done (errors, window) { var year = window.$('h1').text().replace(/[^\d]/g, ''); console.log('This is', year); }