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

css-to-xpath

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-to-xpath - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

8

js/css_to_xpath.js
(function() {
var self = this;
var parser, xpathBuilder, Expression, parse;
var parser, xpathBuilder, Expression, parse, convertToXpath;
parser = require("bo-selector").parser;

@@ -14,3 +14,7 @@ xpathBuilder = require("xpath-builder").dsl();

};
exports.parse = parse;
convertToXpath = function(selector) {
return parse(selector).toXPath();
};
convertToXpath.parse = parse;
module.exports = convertToXpath;
}).call(this);
{
"name": "css-to-xpath",
"version": "0.0.1",
"version": "0.0.2",
"description": "Converts CSS selectors to xpaths",

@@ -34,3 +34,3 @@ "main": "js/css_to_xpath.js",

"name": "Josh Chisholm",
"email": "joshchisholm@gmail.com",
"email": "josh@featurist.co.uk",
"url": "http://featurist.co.uk/"

@@ -37,0 +37,0 @@ },

# css-to-xpath
Converts CSS3 selectors to their XPath equivalents
Converts [CSS3 selectors](http://www.w3.org/TR/css3-selectors/#selectors) to their XPath equivalents.
[![Build Status](https://secure.travis-ci.org/featurist/css-to-xpath.png?branch=master)](http://travis-ci.org/featurist/css-to-xpath)
### Usage
```js
var cssToXPath = require('css-to-xpath');
cssToXPath('p:not(:has(a.x))');
```
...returns the string:
```
.//p[not(.//a[contains(concat(' ', normalize-space(./@class), ' '), ' x ')])]
```
### How?
css-to-xpath parses css selectors using [bo-selector](https://github.com/featurist/bo-selector) and turns them into xpaths using [xpath-builder](https://github.com/featurist/xpath-builder)
### Install
npm install css-to-xpath
### License
BSD

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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