Skip to content

Query over your scrapped html with native js query syntax simply using `plk.byQuery('div > a.coolClass')`

License

Notifications You must be signed in to change notification settings

saurabhdaware/plk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.' ]

About

Query over your scrapped html with native js query syntax simply using `plk.byQuery('div > a.coolClass')`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published