0.0.1 • Published 8 years ago

xpath-query v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

xpath-query

Create Xpath query in javascript

travis npm david-dm

Install

Run

$ npm test
$ npm run build
$ npm run lint

API

  • tag
  • findByText
  • findByTextContent
  • following
  • select
  • first
  • last
  • all
  • attribute
  • custom

Demo

import XpathUtils from '../src/index'
  
const Xpath = new XpathUtils()

const request = Xpath.request()
	.tag(['input', 'span'])
	.tag(['h1', 'h2', 'h3'])
	.done()

// result '//input/h1 | //input/h2 | //input/h3 | //span/h1 | //span/h2 | //span/h3'