Skip to content

xuexb/xpath

Repository files navigation

  • 生成元素对应的xpath路径
  • 根据xpath路径获取对应的元素

code style fecs Build Status Codacy Badge Test Coverage

api

getXpath

/**
 * 获取元素xpath路径
 *
 * @param  {HTMLElement} element 元素
 * @param  {HTMLElement} [context=document.body] 父节点
 *
 * @return {string}
 */
function getXpath(element, context) {}

parseXpath

/**
 * 解析xpath路径为dom元素
 *
 * @param  {string} query   xpath路径
 * @param  {HTMLElement} [context=document.body] 父节点
 *
 * @return {HTMLElement}
 */
function parseXpath(query, context) {}

License

Apache 2.0

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •