修改问题
This commit is contained in:
parent
f895ec6aa4
commit
ef26e1967f
|
|
@ -3,3 +3,4 @@
|
|||
/src/.amo-upload-uuid
|
||||
/src/web-ext-artifacts
|
||||
/.chrome-debug
|
||||
/.vscode
|
||||
|
|
@ -369,11 +369,14 @@ ortoni.buildXpath = (element, boolAnchor) => {
|
|||
|
||||
// let childNextSibling = element.nextSibling;
|
||||
let preiousSiblingElement = element.previousElementSibling;
|
||||
|
||||
let childElement = element.children;
|
||||
for (const child of childElement) {
|
||||
console.log(child); // 只有 <span>,没有 #text
|
||||
}
|
||||
// To iterate all attributes xpath
|
||||
try { xpathAttributes(attributeElement, tagName, element); } catch (e) { }
|
||||
|
||||
// Following-sibling push to array
|
||||
// Following-sibling push to array 根据前一个兄弟节点的对象来定位的
|
||||
try { xpathFollowingSibling(preiousSiblingElement, tagName); } catch (e) { }
|
||||
|
||||
// Text Based xpath
|
||||
|
|
@ -837,7 +840,7 @@ function addPreviousSibling(preSib, tagName) {
|
|||
case 'robotid':
|
||||
if (preSib.hasAttribute('robotid')) {
|
||||
tempvalue = item.value
|
||||
// 这个获取的是前一个兄弟节点的元素
|
||||
// 这个获取的是前一个兄弟节点的元素,不能直接推送
|
||||
// xpathArray.push([2, 'Following sibling based RobotId:', tempvalue])
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue