2.1.9 • Published 2 years ago

@toctive-com/hotfetch v2.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

hotfetch

Scrape pages and extract data in ease

Get Started

Here is a simple explanation to start using HotFetch without a problem

Installing

First you have to install the package through one of the following commands:

npm i hotfetch

# or with Yarn
yarn add hotfetch

If you encounter a problem with temporary files or any other problem with the installation process, you can install HotFetch through one of the following commands:

npm i toctive-com/hotfetch

# or with Yarn
yarn add toctive-com/hotfetch

You will get the same result in the end as both packages HotFetch and toctive-com/hotfetch contain exactly the same code but both in different registry

  • hotfetch in NPM Registry
  • toctive-com/hotfetch in GitHub Packages Registry (GPR)

How to use

basics

First import HotFetch class from hotfetch and create a new instance:

import axios from "axios";
import HotFetch from "hotfetch";

// download the HTML content of a web page
axios.get("https://stackoverflow.com/questions").then((res) => {
  const hf = new HotFetch();
  hf.loadHTML(res.data);

  // structure of the data you want to get
  const result = hf.extract({
    title: { selector: "h1" },
  });

  console.log(result); // { title: All Questions }
});
2.0.8

2 years ago

2.1.9

2 years ago

2.0.7

2 years ago

2.0.5

2 years ago

2.0.0

2 years ago