Created
May 15, 2013 06:12
-
-
Save niceaji/5581954 to your computer and use it in GitHub Desktop.
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 characters
#!/usr/bin/env node | |
/** | |
npm install cheerio request step | |
chmod +x urlparser.js | |
./urlparser.js | |
*/ | |
var cheerio = require('cheerio') | |
, request = require('request') | |
, Step = require('step') | |
Step( | |
function readUrl(){ | |
request("http://daum.net", this); | |
}, | |
function allImgUrl(err, data){ | |
if (err) throw err; | |
var html = data.body | |
, $ = cheerio.load(html) | |
$('img').each(function(index, el){ | |
console.log( $(el).attr('src') ); | |
}); | |
} | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment