plk

0.1.0-alpha.2 • Public • Published

Pluck (plk)

Query over your scrapped html with native js query syntax simply using plk.byQuery('div.content')

Umm.. You're too early D:

This is not ready to be used yet. You can contact me on my twitter@saurabhcodes for any help with contributions.

Usage

plk.byQuery(cssQuery, htmlContent);

Example

const plk = require('plk');
const html = `<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <div class="content">
      <div class="blue">
        <p>This is some paragraph inside div tag.</p>
      </div>
      <div class="green">
        <p>This is some paragraph inside mewdiv tag.</p>
      </div>
    </div>
  </body>
</html>`;

console.log(plk.byQuery('p',html));

Outputs:

[ 'This is some paragraph inside div tag.', 'This is some paragraph inside mewdiv tag.' ]

Package Sidebar

Install

npm i plk

Weekly Downloads

0

Version

0.1.0-alpha.2

License

MIT

Unpacked Size

5.18 kB

Total Files

7

Last publish

Collaborators

  • saurabhdaware