wgxpath

WebJar for wgxpath

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

wgxpath
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

wgxpath
WebJar for wgxpath
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jacobmarble/node-wgxpath

Скачать wgxpath

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/wgxpath/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>wgxpath</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/wgxpath/
implementation 'org.webjars.npm:wgxpath:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/wgxpath/
implementation ("org.webjars.npm:wgxpath:1.1.0")
'org.webjars.npm:wgxpath:jar:1.1.0'
<dependency org="org.webjars.npm" name="wgxpath" rev="1.1.0">
  <artifact name="wgxpath" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='wgxpath', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "wgxpath" % "1.1.0"
[org.webjars.npm/wgxpath "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

node-wgxpath

Wicked Good XPath is a fast implementation of document.createExpression and document.evaluate (DOM3-XPath) in pure Javascript.

Version

x.y.z: x.y refers to the Wicked Good XPath revision when wgxpath.install.js was built; z refers to any improvements to this package.

I'm pretty lazy, so I don't build Wicked Good XPath myself. When the pre-compiled wgxpath.install.js is updated, I'll update this package.

Installation

Install with npm:

npm install wgxpath

Make sure things are working:

node node_modules/wgxpath/word_of_the_day.js

Example

This example scrapes the Merriam-Webster Word of the Day. This code can also be found in word_of_the_day.js. Be sure to install jsdom 3.x before running the example.

$ npm install jsdom@"<4"
var wgxpath = require('wgxpath');
var jsdom = require('jsdom');

var url = 'http://www.merriam-webster.com/word-of-the-day/';
var expressionString = '//*[@id="content"]/div[3]/ul/li[1]/strong';

jsdom.env({
  html: url,
  done: function(errors, window) {
    wgxpath.install(window);
    var expression = window.document.createExpression(expressionString);
    var result = expression.evaluate(window.document,
        wgxpath.XPathResultType.STRING_TYPE);
    console.log('The Word of the Day is "' + result.stringValue + '."');
  }
});

Версии библиотеки

Версия
1.1.0