Socket
Socket
Sign inDemoInstall

@medv/finder

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@medv/finder

CSS Selector Generator


Version published
Weekly downloads
117K
decreased by-15.18%
Maintainers
1
Weekly downloads
 
Created

What is @medv/finder?

@medv/finder is an npm package that provides a utility for generating unique CSS selectors for DOM elements. This can be particularly useful for tasks such as automated testing, web scraping, and browser automation where you need to reliably identify and interact with specific elements on a web page.

What are @medv/finder's main functionalities?

Generate Unique CSS Selectors

This feature allows you to generate a unique CSS selector for a given DOM element. The generated selector can be used to reliably identify the element in various contexts such as automated tests or web scraping.

const finder = require('@medv/finder');
const element = document.querySelector('your-element-selector');
const selector = finder(element);
console.log(selector);

Customizable Options

This feature allows you to customize the options for generating the CSS selector. You can specify the root element, and control the inclusion of IDs, class names, tag names, and attributes in the generated selector.

const finder = require('@medv/finder');
const element = document.querySelector('your-element-selector');
const selector = finder(element, {
  root: document.body,
  idName: (name) => true,
  className: (name) => true,
  tagName: (name) => true,
  attr: (name, value) => false,
  seedMinLength: 1,
  optimizedMinLength: 2,
});
console.log(selector);

Other packages similar to @medv/finder

Keywords

FAQs

Package last updated on 27 Aug 2021

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