Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

craw

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

craw

a website-crawler library for nodejs

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

CRAW

a website-crawler library for nodejs

Documentation

Documentation of the library in a summarized and precise way.

Usage

const craw = require('craw');

async function start () {
  const result = await craw("https://2lstudios.dev/");
  console.log(result.toJSON());
}

start();

result.getContent()

Get the content of the website as headers, paragraphs, paragraphs and all the text in general.
Output:

{
  text: "....", // String
  h1: [], // Array
  h2: []. // Array
  h3: [], // Array
  h4: [], // Array
  h5: [], // Array
  h6: [], // Array
  words: [] // Array
}

result.getFrames()

Get a list with iframes from the website.
Output:

[...]  // Array

result.getImports()

Get a list of imports from the website. (like css, favicon and js)
Output:

{
  scripts: [ // Array
    {
      integrity: "...", // String
      src: "...", // String
      async: ... // Boolean
    }
  ],

  styles: [ // Array
    {
      integrity: "...", // String
      href: "...", // String
      rel: "..." // String
    }
  ],
  
  favicon: {
    type: "...", // String
    href: "..." // String 
  }
}

Get a list of hyperlinks from the website.
Output:

[ // Array
  {
    url: "...", // String
    anchor: "...", // String
    rel: [ ... ] // Array of Strings
  }
]

result.getMedia()

Get a list of multimedia elements from the website. (Like images, audios and videos)
Output:

{
  audios: [ // Array
    {
      src: "...", // String
      type: "..." // String
    }
  ],
  images: [ // Array
    {
      src: "...", // String
      alt: "...", // String
      loading: "..." // String
    }
  ],
  videos: [ ... ] // Array of strings
}

result.getMeta()

Get a list of metadata tags from the website.
Output:

{
  author: "...", // String
  viewport: "...", // String
  robots: "...", // String
  description: "...", // String
  keywords: [], // Array of strings
  image: "...", // String (Favicon)
  charset: "...", // String
  ... any other metadata tag like OG or Twitter ...
}

result.getTitle()

Get the title of the website.
Output:

"..." // String	

result.toJSON()

Run all functions and add the results of each one in the same object.

Keywords

FAQs

Package last updated on 20 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc