artixtract

Extracts article text from a webpage

Usage no npm install needed!

<script type="module">
  import artixtract from 'https://cdn.skypack.dev/artixtract';
</script>

README

artixtract Build Status

Extracts article text from a web page

Installation

npm install artixtract

Usage

Load using a URL

var artixtract = require('artixtract');

artixtract.loadUrl("https://github.com/avivklas")
    .then(function(article){
        
        for(var paragraph in article.paragraphs){
            console.log(paragraph)
        }
        
    }).done();

Load using an HTML

var artixtract = require('artixtract');

artixtract.loadHtml("<div>"
                    + "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis cursus varius. Nam ex ligula, bibendum in ex nec, rutrum dictum nisl. Vestibulum metus.</p>"
                    + "<p>Mauris blandit fringilla ligula, condimentum tristique augue aliquam non. Integer quis ipsum sollicitudin, placerat eros in, pretium ligula. Etiam vel sed.</p>"
                    + "<div>")
    .then(function(article){
        
        for(var paragraph in article.paragraphs){
            console.log(paragraph)
        }
        
    }).done();