get 不能獲取到 網(wǎng)頁數(shù)據(jù)
下面的代碼獲取不到網(wǎng)頁的數(shù)據(jù)
?http.get('http://www.meet99.com/map-beijing.html?
',function(content){
????????var?html?=?'';
????????content.on('data',function(data){
????????????html?+=?data;
????????});
????????content.on('end',function(){
????????????console.log(html);
????????});
????}).on('error',function(e){
????????console.log('ERROR:'+e);
????});
2017-10-06
1、網(wǎng)址可以打開;
2、你換一個url測試就知道,代碼沒有寫錯。
可能是這個網(wǎng)站屏蔽了,你可以模擬header頭來試下抓取,用request方法
2017-07-16
http require沒?還有你那個網(wǎng)址有沒有內(nèi)容?沒有內(nèi)容肯定沒東西,我打不開你那個網(wǎng)址