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

html-scrape

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-scrape

A lightweight tool that scrapes webpages with ease.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

HTML Scrape


A tool that will scrape html webpages with ease.

To install:

npm install html-scrape

Example of usage for finding a value in between something:

var scrape = require('html-scrape');

var elements = {
	title: { start: '<title>', end: '</title>' },
	meta: { start: '<meta content="', end: '"'}
}

scrape ('http://www.google.com', elements, (error, data) => {
	if (error) {
		console.log(error);
	} else {
		console.log(data);
	}
});

Above would return:

{
	title: 'Google',
	meta: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.'
}

options

host [string | required] - URL of webpage you are wanting to scrape.

elements [string | required] - String that you will be searching.

start [string | required] - String before the value you are searching for. For instance - <title>value</title>: In this example, the header would be <title>

end (find, replace) [string | required] - String after the value you are searching for. For instance - <title>value</title>: In this example, the header would be </title>

callback [function] - Function that returns data after scraping is finished.

error [string] - Hold error if one was encountered during the scraping process.

data [string] - Holds object of data returned from the scraper.

Keywords

FAQs

Package last updated on 28 Feb 2016

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