0.0.3 • Published 7 years ago

dom-finder v0.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

finder

A finder use XPath expression to find dom

Usage

npm install dom-finder
Finder.findNode(selector, context) => selector could be id,class,name,tagName,text,value
Finder.advanceFind(opts) => find node with indicated attribute list, and find node in specifc context
opts: {
  tagName, //just tagName, like: div,p,input,etc.
  attrs,   //an attribute list that could contains any attribute like: href,name,title,style,etc.
  context, //could be another opts just like this one
  global,  //will match all nodes whether is child or grandchild default true
  contains //contains attribute value or equals attribute value default true
}
Finder.verison()=> get the current Finder version
//search for text
Finder.advanceFind({attrs: {text: "some text"}});

Enjoy

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago