mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-16 16:26:56 +08:00
点击元素和移动到元素的默认名称更改为点击/移动到的元素的文本值
This commit is contained in:
parent
5921d84140
commit
fd9d2b5b24
Binary file not shown.
Binary file not shown.
@ -454,6 +454,31 @@ function toolBoxKernel(e, para = null) {
|
|||||||
let l = nodeList.length;
|
let l = nodeList.length;
|
||||||
let nt = null;
|
let nt = null;
|
||||||
let nt2 = null;
|
let nt2 = null;
|
||||||
|
if (option == 2 || option == 7) { //点击元素或移动到元素操作的名称更改
|
||||||
|
let l = 6;
|
||||||
|
if(option == 2){
|
||||||
|
title = LANG("点击", "Click ");
|
||||||
|
} else {
|
||||||
|
title = LANG("移动到", "Move to ");
|
||||||
|
l = 5;
|
||||||
|
}
|
||||||
|
content = para["content"];
|
||||||
|
let str = content.trim();
|
||||||
|
if (str == "") {
|
||||||
|
title += LANG("元素", "Element");
|
||||||
|
} else {
|
||||||
|
if(window.location.href.indexOf("_CN") != -1){ //中文
|
||||||
|
if (str.length > l) {
|
||||||
|
str = str.substring(0, l) + "...";
|
||||||
|
}
|
||||||
|
} else { //英文
|
||||||
|
if (str.length > l + 7) {
|
||||||
|
str = str.substring(0, l + 7) + "...";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
title += str;
|
||||||
|
}
|
||||||
|
}
|
||||||
let t = {
|
let t = {
|
||||||
id: 0,
|
id: 0,
|
||||||
index: l,
|
index: l,
|
||||||
@ -704,7 +729,7 @@ document.oncontextmenu = function() {
|
|||||||
contextMenu.style.position = "absolute";
|
contextMenu.style.position = "absolute";
|
||||||
contextMenu.style.left = event.clientX + "px";
|
contextMenu.style.left = event.clientX + "px";
|
||||||
contextMenu.style.top = event.clientY + "px";
|
contextMenu.style.top = event.clientY + "px";
|
||||||
contextMenu.style.width = LANG("180px", "220px");
|
contextMenu.style.width = LANG("180px", "250px");
|
||||||
|
|
||||||
// 添加删除元素的功能
|
// 添加删除元素的功能
|
||||||
contextMenu.addEventListener("dblclick", function() {
|
contextMenu.addEventListener("dblclick", function() {
|
||||||
|
@ -1 +1 @@
|
|||||||
{"language":"zh"}
|
{"language":"en"}
|
@ -69,6 +69,7 @@ export function sendSingleClick() {
|
|||||||
"tabIndex": -1,
|
"tabIndex": -1,
|
||||||
"useLoop": false, //是否使用循环内元素
|
"useLoop": false, //是否使用循环内元素
|
||||||
"iframe": global.iframe,
|
"iframe": global.iframe,
|
||||||
|
"content": global.nodeList[0]["node"].innerText,
|
||||||
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
||||||
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
||||||
};
|
};
|
||||||
@ -107,6 +108,7 @@ export function sendMouseMove(){
|
|||||||
"tabIndex": -1,
|
"tabIndex": -1,
|
||||||
"useLoop": false, //是否使用循环内元素
|
"useLoop": false, //是否使用循环内元素
|
||||||
"iframe": global.iframe,
|
"iframe": global.iframe,
|
||||||
|
"content": global.nodeList[0]["node"].innerText,
|
||||||
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
||||||
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
||||||
};
|
};
|
||||||
@ -125,6 +127,7 @@ export function sendLoopMouseMove(){
|
|||||||
"tabIndex": -1,
|
"tabIndex": -1,
|
||||||
"xpath": "", //默认值设置为空
|
"xpath": "", //默认值设置为空
|
||||||
"allXPaths": "",
|
"allXPaths": "",
|
||||||
|
"content": "",
|
||||||
"useLoop": true, //是否使用循环内元素
|
"useLoop": true, //是否使用循环内元素
|
||||||
"iframe": global.iframe,
|
"iframe": global.iframe,
|
||||||
"loopType": 1, //循环类型,1为不固定元素列表
|
"loopType": 1, //循环类型,1为不固定元素列表
|
||||||
@ -231,6 +234,7 @@ export function sendLoopClickSingle(name) {
|
|||||||
"tabIndex": -1,
|
"tabIndex": -1,
|
||||||
"useLoop": true, //是否使用循环内元素
|
"useLoop": true, //是否使用循环内元素
|
||||||
"iframe": global.iframe,
|
"iframe": global.iframe,
|
||||||
|
"content": global.nodeList[0]["node"].innerText,
|
||||||
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
"xpath": readXPath(global.nodeList[0]["node"], 0),
|
||||||
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
"allXPaths": getElementXPaths(global.nodeList[0]["node"]),
|
||||||
"loopType": 0, //循环类型,0为单个元素
|
"loopType": 0, //循环类型,0为单个元素
|
||||||
@ -256,6 +260,7 @@ export function sendLoopClickEvery() {
|
|||||||
"tabIndex": -1,
|
"tabIndex": -1,
|
||||||
"xpath": "", //默认值设置为空
|
"xpath": "", //默认值设置为空
|
||||||
"allXPaths": "",
|
"allXPaths": "",
|
||||||
|
"content": "",
|
||||||
"useLoop": true, //是否使用循环内元素
|
"useLoop": true, //是否使用循环内元素
|
||||||
"iframe": global.iframe,
|
"iframe": global.iframe,
|
||||||
"loopType": 1, //循环类型,1为不固定元素列表
|
"loopType": 1, //循环类型,1为不固定元素列表
|
||||||
|
Loading…
x
Reference in New Issue
Block a user