domtoxpath

Chromium devtools XPath generation method

Usage no npm install needed!

<script type="module">
  import domtoxpath from 'https://cdn.skypack.dev/domtoxpath';
</script>

README

domToXpath

Chromium devtools XPath generation method

与chrome 开发者工具获取xpath 一样

domXpath.xPath(dom)  // 完整Xpath
domXpath.xPath(dom,true) // 短路Xpath