小爬虫程序报错怎么回事啊
老师为什么下面程序在我cmd中跑就报错
var http = require('http')
var url = 'http://www.runoob.com/nodejs/nodejs-tutorial.html';
http.get(url,function(res){
var html=''
res.on('data',funtion(data){
html+=data
})
res.on('end',function(){
console.log(html)
})
}).on('error',function(){
console.log('获取资源出错!')
})