You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@dev-alisson-fernandes/get-files-by-css-selectors

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dev-alisson-fernandes/get-files-by-css-selectors

Download files from url using css selectors to find the source of the files

1.5.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Get Files By Css Selectors

About

This package is recommended for situations where you want to download the files of a site by it doesn't have an option like a download button or an easy way to do it

Features

  • ✅ Access a web page and take a print screen
  • ✅ Create a specific folder using the given site link
  • ✅ Download any type of file(with or without extension on url) using a given css selector

Features in development

  • ⚙️ Add replace option to get the original image using the thumb image
  • ⚙️ Add login option with .ENV to sites that require authentication
  • ⚙️ Verify if file already exists and don't save download again(in cases when the downloads break by some reason)

Tecnologies Used

Nodeaxiospuppeteer
16.131.3.119.6.3

Getting Started

Install @dev-alisson-fernandes/get-files-by-css-selectors as a npm module

npm i @dev-alisson-fernandes/get-files-by-css-selectors

Usage

// import
import GetFilesByCssSelectors from '@dev-alisson-fernandes/get-files-by-css-selectors';
const getFilesByCssSelectors = new GetFilesByCssSelectors;

Example 1 - Twitter

// define params
let randomSite = 'https://twitter.com/UOLEconomia';
let cssSelectors = 'img[class~="css-9pa8cd"]';
let attrName = 'src';

// run
await getFilesByCssSelectors.run(randomSite, cssSelectors, attrName);

Example 2 - Instagram

// define params
let randomSite = 'https://www.instagram.com/uoloficial/';
let cssSelectors = 'img[class="x5yr21d xu96u03 x10l6tqk x13vifvy x87ps6o xh8yej3"]';
let attrName = 'src';

// run
await getFilesByCssSelectors.run(randomSite, cssSelectors, attrName);

Logs

// show array logs in the end
getFilesByCssSelectors.getLogs();

// Disable showing logs durant run process
getFilesByCssSelectors.setConfig({ infiniteScroll: false });

InfiniteScroll

By default, all pages will be scrolled to the end before search elements, but you can disable this behavior with the code below

getFilesByCssSelectors.setConfig({ infiniteScroll: false });

Dev

  • RUN TESTS: npm test
  • RUN LINT: npm eslint

License

GNU General Public License v3.0 (https://www.gnu.org/licenses/gpl-3.0.html)

Keywords

download

FAQs

Package last updated on 08 Mar 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.