const getNodesByXPath = (xpath) => { const result = document.evaluate( xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); return [...Array(result.snapshotLength)].map((_, i) => result.snapshotItem(i)); }; const nodes = getNodesByXPath('//div'); nodes; // [div, div, div, ...] 3. XPath ã¨ã¯ 3.1. æ¦è¦ XPath ã¨ã¯ XML ææ¸ï¼HTML å«ãï¼ã®ãã¾ãã¾ãªãã¼ããæã示ããã¨ãã§ãããã¹æååã®ãã¨ã§ãã XPath 㯠XML Path Language ã®ç¥
{{#tags}}- {{label}}
{{/tags}}