slector
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

Slector Banner

Slector

Preparing Queries for Web-Scraping

This package is used to create 'Slectors' (otherwise known as DOM Queries) which you can then use in your Web Scraping | Machine Learning projects.

Quickstart Guide

Initialise a Node Project.

Install Slector:

npm install slector -D

Import Slector:

import Slector from "slector";

Create a Slector options object:

const options = {showExtConsole: true, collectionTypes: ["EndPoint", "Method Description"], startUrl: "https://www.coingecko.com/en/api/documentation", slectors: previousSlectors, exportTextContent: true,}

Slector Options Available

Property Definition Required?
collectionTypes string[]: The available Slector names/categories/groups.
startUrl string: The first url to navigate to (after extension setup)
slectors slectors[]: Previously exported slector data to load on setup.
exportTextContent boolean: Will collect text content of all highlighted DOM elements.
showExtConsole boolean: Will open background-script inspector on startup.

Create a new Slector Instance:

const slector = new Slector(options);

Run Slector and export data:

const res = await slector.slect();

Open the browser, make your selections, and when you click 'DONE' in the extension - return all your Slector Instance JSON data.

Readme

Keywords

none

Package Sidebar

Install

npm i slector

Weekly Downloads

1

Version

2.4.1

License

MIT

Unpacked Size

154 kB

Total Files

43

Last publish

Collaborators

  • tjmblake