Comparing version 0.1.2 to 0.1.3
@@ -1,5 +0,4 @@ | ||
var read = require('../'); | ||
read('http://news.eastday.com/eastday/13news/auto/news/finance/u7ai1549096_K4.html', { | ||
read('http://news.china.com/hd/11127798/20140603/18539030.html', { | ||
dataType: { | ||
@@ -19,4 +18,12 @@ type: 'text', | ||
console.log('[INFO]', 'title:', art.title); | ||
console.log('[INFO]', 'content:', art.content); | ||
console.log('[INFO]', 'title:', art.title); | ||
}); | ||
}); | ||
/* | ||
var cheerio = require('cheerio'); | ||
var $ = cheerio.load('<p><small style="display: block;visibility: hidden;">HIDE</small>SHOW</p>'); | ||
$('small').each(function(){ | ||
var node = $(this); | ||
console.log(node.css('visibility')); | ||
})*/ |
@@ -67,2 +67,9 @@ // Copyright 2014 Tjatse | ||
} | ||
// remove element that invisible. | ||
if(node.css('display') == 'none' || node.css('visibility') == 'hidden'){ | ||
node.remove(); | ||
return; | ||
} | ||
// use blank to separate class and id to avoid incorrect operation, e.g.: | ||
@@ -69,0 +76,0 @@ // <div id="side" class="bar>...., the class_Id var will be sidebar, so, it make |
{ | ||
"name": "read-art", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Scrape article from any page, automatically, make web page readability.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
39542
957