mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-16 16:26:56 +08:00
Point动画效果
This commit is contained in:
parent
ed0768ca51
commit
c41ec1dcd0
@ -652,7 +652,7 @@ if (sId != null && sId != -1) //加载任务
|
||||
node["parameters"]["cookies"] = "";
|
||||
}
|
||||
} else if(node["option"] == 3){ //提取数据
|
||||
if(node["parameters"]["paras"] != undefined){
|
||||
if(node["parameters"]["paras"] != undefined && node["parameters"]["params"] == undefined){
|
||||
node["parameters"]["params"] = node["parameters"]["paras"];
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1,337 @@
|
||||
{"id":210,"name":"360安全浏览器2023最新版下载-全面保护上网安全就选360安全浏览器-华军软件园","url":"https://www.onlinedown.net/soft/66801.htm","links":"https://www.onlinedown.net/soft/66801.htm","create_time":"10/10/2023, 10:39:02 PM","update_time":"10/10/2023, 10:39:02 PM","version":"0.5.0","saveThreshold":10,"cloudflare":0,"environment":0,"maxViewLength":15,"recordLog":1,"outputFormat":"xlsx","saveName":"current_time","inputExcel":"","startFromExit":0,"containJudge":false,"desc":"https://www.onlinedown.net/soft/66801.htm","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.onlinedown.net/soft/66801.htm","desc":"要采集的网址列表,多行以\\n分开","type":"text","exampleValue":"https://www.onlinedown.net/soft/66801.htm"}],"outputParameters":[],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2,3],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"waitElement":"","waitElementTime":10,"waitElementIframeIndex":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"waitElement":"","waitElementTime":10,"waitElementIframeIndex":0,"url":"https://www.onlinedown.net/soft/66801.htm","links":"https://www.onlinedown.net/soft/66801.htm","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":2,"index":2,"parentId":0,"type":0,"option":2,"title":"点击立即下载","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[contains(@class, \"lj-btn\")]","iframe":false,"wait":2,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"waitElement":"","waitElementTime":10,"waitElementIframeIndex":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"params":[],"allXPaths":["/html/body/section[1]/div[1]/div[1]/div[3]/div[2]/div[1]/div[1]/a[1]/b[1]","//b[contains(., '立即下载')]","//B[@class='lj-btn']","/html/body/section/div/div[last()-4]/div[last()-1]/div/div[last()-1]/div/a[last()-1]/b"]}},{"id":3,"index":3,"parentId":0,"type":0,"option":2,"title":"点击通用网络下载","sequence":[],"isInLoop":false,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[contains(@class, \"down-list\")]/div[2]/p[1]/a[1]","iframe":false,"wait":2,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"waitElement":"","waitElementTime":10,"waitElementIframeIndex":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"clickWay":0,"maxWaitTime":10,"params":[],"allXPaths":["/html/body/section[1]/div[1]/div[2]/div[1]/div[4]/div[1]/div[1]/div[2]/p[1]/a[1]","//a[contains(., '通用网络下载')]","//A[@class='qrcode_show rest']","/html/body/section/div/div[last()-3]/div[last()-1]/div[last()-4]/div/div[last()-1]/div[last()-1]/p/a[last()-1]"]}}]}
|
||||
{
|
||||
"id": 210,
|
||||
"name": "【海鸥怎么样】海鸥口碑好不好_缺点_优点_点评_易车",
|
||||
"url": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"links": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"create_time": "12/15/2023, 5:15:10 PM",
|
||||
"update_time": "12/20/2023, 4:13:00 PM",
|
||||
"version": "0.6.0",
|
||||
"saveThreshold": 10,
|
||||
"quitWaitTime": 60,
|
||||
"environment": 0,
|
||||
"maximizeWindow": 0,
|
||||
"maxViewLength": 15,
|
||||
"recordLog": 1,
|
||||
"outputFormat": "xlsx",
|
||||
"saveName": "current_time",
|
||||
"dataWriteMode": 1,
|
||||
"inputExcel": "",
|
||||
"startFromExit": 0,
|
||||
"pauseKey": "p",
|
||||
"containJudge": false,
|
||||
"browser": "chrome",
|
||||
"removeDuplicate": 0,
|
||||
"desc": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"inputParameters": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "urlList_0",
|
||||
"nodeId": 1,
|
||||
"nodeName": "打开网页",
|
||||
"value": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"desc": "要采集的网址列表,多行以\\n分开",
|
||||
"type": "text",
|
||||
"exampleValue": "https://dianping.yiche.com/haiou/koubei/"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "loopTimes_1",
|
||||
"nodeId": 2,
|
||||
"nodeName": "循环",
|
||||
"desc": "循环循环执行的次数(0代表无限循环)",
|
||||
"type": "int",
|
||||
"exampleValue": 100,
|
||||
"value": 100
|
||||
}
|
||||
],
|
||||
"outputParameters": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "参数1",
|
||||
"desc": "",
|
||||
"type": "text",
|
||||
"recordASField": 1,
|
||||
"exampleValue": "\n \n \n \n \n \n \n 浑然一体水蜜桃1535\n \n \n \n 车主\n \n \n \n 2023-09-29\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 海鸥 2023款 405km 飞翔版\n \n \n \n \n \n 4.43\n \n 裸车价\n 9.28万元\n \n \n \n \n 购车时间\n 2023-09\n \n \n \n \n \n \n \n \n 🕙购车经历\n销售答应了一堆配件,但是一个都没给我呢,我也不知道啥时候能给我,如果最后还是不给我,我打算曝光他们,太过分了,一个月了,都没轮到我。!!!\n一问就是没啦,当初是答应的好好的 。交了钱就装不上这些零件了。太过分了这些销售。大家要小心销售骗你哦。反正最后不给我我就去门口拉条幅去。车停他门口。警告其他消费者。\n💴提车价格\n92800 保险5300 上牌500\n⛽充电时间\n1小时吧,没有特别低的时候去充电\n🌍续航\n夏天的高温天气也让我对海鸥黑色的使用感到***。由于黑色的车身吸热较多,内部温度会比外部更高。因此,在炎炎夏日,我经常需要开启空调以\n 查看完整点评>>\n \n \n \n \n \n \n \n \n \n \n 共9 张\n \n \n \n \n \n "
|
||||
}
|
||||
],
|
||||
"graph": [
|
||||
{
|
||||
"index": 0,
|
||||
"id": 0,
|
||||
"parentId": 0,
|
||||
"type": -1,
|
||||
"option": 0,
|
||||
"title": "root",
|
||||
"sequence": [1, 2],
|
||||
"parameters": {
|
||||
"history": 1,
|
||||
"tabIndex": 0,
|
||||
"useLoop": false,
|
||||
"xpath": "",
|
||||
"iframe": false,
|
||||
"wait": 0,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0
|
||||
},
|
||||
"isInLoop": false
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"index": 1,
|
||||
"parentId": 0,
|
||||
"type": 0,
|
||||
"option": 1,
|
||||
"title": "打开网页",
|
||||
"sequence": [],
|
||||
"isInLoop": false,
|
||||
"position": 0,
|
||||
"parameters": {
|
||||
"useLoop": false,
|
||||
"xpath": "",
|
||||
"wait": 5,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0,
|
||||
"url": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"links": "https://dianping.yiche.com/haiou/koubei/",
|
||||
"maxWaitTime": 10,
|
||||
"scrollType": 0,
|
||||
"scrollCount": 1,
|
||||
"scrollWaitTime": 1,
|
||||
"cookies": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"index": 2,
|
||||
"parentId": 0,
|
||||
"type": 1,
|
||||
"option": 8,
|
||||
"title": "循环",
|
||||
"sequence": [4, 3],
|
||||
"isInLoop": false,
|
||||
"position": 1,
|
||||
"parameters": {
|
||||
"history": 4,
|
||||
"tabIndex": -1,
|
||||
"useLoop": false,
|
||||
"xpath": "//*[contains(@class, \"next\")]",
|
||||
"iframe": false,
|
||||
"wait": 0,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0,
|
||||
"scrollType": 0,
|
||||
"scrollCount": 1,
|
||||
"scrollWaitTime": 1,
|
||||
"loopType": 0,
|
||||
"pathList": "",
|
||||
"textList": "",
|
||||
"code": "",
|
||||
"waitTime": 0,
|
||||
"exitCount": 100,
|
||||
"historyWait": 2,
|
||||
"breakMode": 0,
|
||||
"breakCode": "",
|
||||
"breakCodeWaitTime": 0,
|
||||
"allXPaths": [
|
||||
"/html/body/div[6]/div[1]/div[5]/div[1]/a[2]",
|
||||
"//a[contains(., '>')]",
|
||||
"//A[@class='link-btn next pg-item']",
|
||||
"/html/body/div[last()-5]/div[last()-3]/div[last()-1]/div/a"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"index": 3,
|
||||
"parentId": 2,
|
||||
"type": 0,
|
||||
"option": 2,
|
||||
"title": "点击元素",
|
||||
"sequence": [],
|
||||
"isInLoop": true,
|
||||
"position": 1,
|
||||
"parameters": {
|
||||
"history": 4,
|
||||
"tabIndex": -1,
|
||||
"useLoop": true,
|
||||
"xpath": "",
|
||||
"iframe": false,
|
||||
"wait": 5,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0,
|
||||
"scrollType": 0,
|
||||
"scrollCount": 1,
|
||||
"scrollWaitTime": 1,
|
||||
"clickWay": 0,
|
||||
"maxWaitTime": 10,
|
||||
"paras": [],
|
||||
"allXPaths": [
|
||||
"/html/body/div[6]/div[1]/div[5]/div[1]/a[2]",
|
||||
"//a[contains(., '>')]",
|
||||
"//A[@class='link-btn next pg-item']",
|
||||
"/html/body/div[last()-5]/div[last()-3]/div[last()-1]/div/a"
|
||||
],
|
||||
"loopType": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"index": 4,
|
||||
"parentId": 2,
|
||||
"type": 1,
|
||||
"option": 8,
|
||||
"title": "循环",
|
||||
"sequence": [5],
|
||||
"isInLoop": true,
|
||||
"position": 0,
|
||||
"parameters": {
|
||||
"history": 5,
|
||||
"tabIndex": -1,
|
||||
"useLoop": false,
|
||||
"xpath": "/html/body/div[6]/div[1]/div[4]/div",
|
||||
"iframe": false,
|
||||
"wait": 0,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0,
|
||||
"scrollType": 0,
|
||||
"scrollCount": 1,
|
||||
"scrollWaitTime": 1,
|
||||
"loopType": 1,
|
||||
"pathList": "",
|
||||
"textList": "",
|
||||
"code": "",
|
||||
"waitTime": 0,
|
||||
"exitCount": 0,
|
||||
"historyWait": 2,
|
||||
"breakMode": 0,
|
||||
"breakCode": "",
|
||||
"breakCodeWaitTime": 0,
|
||||
"allXPaths": [
|
||||
"/html/body/div[6]/div[1]/div[4]/div[1]",
|
||||
"//div[contains(., '')]",
|
||||
"//DIV[@class='cm-content-moudle']",
|
||||
"/html/body/div[last()-5]/div[last()-3]/div[last()-2]/div[last()-19]"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"index": 5,
|
||||
"parentId": 3,
|
||||
"type": 0,
|
||||
"option": 3,
|
||||
"title": "提取数据",
|
||||
"sequence": [],
|
||||
"isInLoop": true,
|
||||
"position": 0,
|
||||
"parameters": {
|
||||
"history": 5,
|
||||
"tabIndex": -1,
|
||||
"useLoop": false,
|
||||
"xpath": "",
|
||||
"iframe": false,
|
||||
"wait": 0,
|
||||
"waitType": 0,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"waitElement": "",
|
||||
"waitElementTime": 10,
|
||||
"waitElementIframeIndex": 0,
|
||||
"clear": 0,
|
||||
"paras": [
|
||||
{
|
||||
"nodeType": 0,
|
||||
"contentType": 0,
|
||||
"relative": true,
|
||||
"name": "参数1",
|
||||
"desc": "",
|
||||
"extractType": 0,
|
||||
"relativeXPath": "",
|
||||
"allXPaths": "",
|
||||
"exampleValues": [
|
||||
{
|
||||
"num": 0,
|
||||
"value": "\n \n \n \n \n \n \n 浑然一体水蜜桃1535\n \n \n \n 车主\n \n \n \n 2023-09-29\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 海鸥 2023款 405km 飞翔版\n \n \n \n \n \n 4.43\n \n 裸车价\n 9.28万元\n \n \n \n \n 购车时间\n 2023-09\n \n \n \n \n \n \n \n \n 🕙购车经历\n销售答应了一堆配件,但是一个都没给我呢,我也不知道啥时候能给我,如果最后还是不给我,我打算曝光他们,太过分了,一个月了,都没轮到我。!!!\n一问就是没啦,当初是答应的好好的 。交了钱就装不上这些零件了。太过分了这些销售。大家要小心销售骗你哦。反正最后不给我我就去门口拉条幅去。车停他门口。警告其他消费者。\n💴提车价格\n92800 保险5300 上牌500\n⛽充电时间\n1小时吧,没有特别低的时候去充电\n🌍续航\n夏天的高温天气也让我对海鸥黑色的使用感到***。由于黑色的车身吸热较多,内部温度会比外部更高。因此,在炎炎夏日,我经常需要开启空调以\n 查看完整点评>>\n \n \n \n \n \n \n \n \n \n \n 共9 张\n \n \n \n \n \n "
|
||||
}
|
||||
],
|
||||
"unique_index": "3z4vpp3jxm6lq6eyhad",
|
||||
"iframe": false,
|
||||
"default": "1",
|
||||
"paraType": "text",
|
||||
"recordASField": 1,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"JS": "",
|
||||
"JSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"downloadPic": 0
|
||||
}
|
||||
],
|
||||
"loopType": 1,
|
||||
"params": [
|
||||
{
|
||||
"nodeType": 0,
|
||||
"contentType": 0,
|
||||
"relative": true,
|
||||
"name": "参数1",
|
||||
"desc": "",
|
||||
"extractType": 0,
|
||||
"relativeXPath": "",
|
||||
"allXPaths": "",
|
||||
"exampleValues": [
|
||||
{
|
||||
"num": 0,
|
||||
"value": "\n \n \n \n \n \n \n 浑然一体水蜜桃1535\n \n \n \n 车主\n \n \n \n 2023-09-29\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 海鸥 2023款 405km 飞翔版\n \n \n \n \n \n 4.43\n \n 裸车价\n 9.28万元\n \n \n \n \n 购车时间\n 2023-09\n \n \n \n \n \n \n \n \n 🕙购车经历\n销售答应了一堆配件,但是一个都没给我呢,我也不知道啥时候能给我,如果最后还是不给我,我打算曝光他们,太过分了,一个月了,都没轮到我。!!!\n一问就是没啦,当初是答应的好好的 。交了钱就装不上这些零件了。太过分了这些销售。大家要小心销售骗你哦。反正最后不给我我就去门口拉条幅去。车停他门口。警告其他消费者。\n💴提车价格\n92800 保险5300 上牌500\n⛽充电时间\n1小时吧,没有特别低的时候去充电\n🌍续航\n夏天的高温天气也让我对海鸥黑色的使用感到***。由于黑色的车身吸热较多,内部温度会比外部更高。因此,在炎炎夏日,我经常需要开启空调以\n 查看完整点评>>\n \n \n \n \n \n \n \n \n \n \n 共9 张\n \n \n \n \n \n "
|
||||
}
|
||||
],
|
||||
"unique_index": "3z4vpp3jxm6lq6eyhad",
|
||||
"iframe": false,
|
||||
"default": "1",
|
||||
"paraType": "text",
|
||||
"recordASField": 1,
|
||||
"beforeJS": "",
|
||||
"beforeJSWaitTime": 0,
|
||||
"JS": "",
|
||||
"JSWaitTime": 0,
|
||||
"afterJS": "",
|
||||
"afterJSWaitTime": 0,
|
||||
"downloadPic": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -24,6 +24,11 @@ export function trial(evt) {
|
||||
let element = node.element;
|
||||
element.style.boxShadow = "none";
|
||||
}
|
||||
// 删除所有class为highlight_of_easyspider的元素
|
||||
let elements = document.getElementsByClassName('highlight_of_easyspider');
|
||||
while (elements.length > 0) {
|
||||
elements[0].parentNode.removeChild(elements[0]);
|
||||
}
|
||||
global.markElements = [];
|
||||
if (type == 0) {
|
||||
let option = node.option;
|
||||
@ -37,8 +42,17 @@ export function trial(evt) {
|
||||
}
|
||||
xpath = parentXPath + xpath;
|
||||
}
|
||||
let point = parameters.xpath;
|
||||
if (xpath.includes("point(")) {
|
||||
xpath = "//body"
|
||||
}
|
||||
let element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
||||
if (element != null) {
|
||||
if (parameters.xpath.includes("point(")) {
|
||||
point = point.substring(6, point.length - 1).split(",");
|
||||
let x = parseInt(point[0]);
|
||||
let y = parseInt(point[1]);
|
||||
highlightAt(x, y);
|
||||
} else if (element != null) {
|
||||
clearEl(true);
|
||||
addEl(null, element);
|
||||
}
|
||||
@ -293,4 +307,29 @@ export function createNotification(text, type = "info") {
|
||||
}
|
||||
});
|
||||
}, timeoutInterval + 500); // 通知停留时间加上动画时间
|
||||
}
|
||||
|
||||
function highlightAt(x, y) {
|
||||
// 创建一个新元素
|
||||
let element = document.createElement('div');
|
||||
|
||||
element.className = 'highlight_of_easyspider'; // 使用 class 方便后续添加样式
|
||||
|
||||
// 设置样式
|
||||
element.style.position = 'absolute';
|
||||
element.style.left = x + 'px';
|
||||
element.style.top = y + 'px';
|
||||
element.style.width = '10px'; // 你可以根据需要设置大小
|
||||
element.style.height = '10px';
|
||||
element.style.backgroundColor = 'blue'; // 高亮颜色
|
||||
element.style.zIndex = '999999999'; // 确保在最上层
|
||||
element.style.pointerEvents = 'none'; // 避免阻挡点击事件
|
||||
//圆形
|
||||
element.style.borderRadius = '50%';
|
||||
// 设置动画
|
||||
element.style.animation = 'blinkAnimation 2s infinite'; // 2秒一个周期的无限循环动画
|
||||
// element.style.border = '1px solid '; // 边框样式
|
||||
|
||||
// 将元素添加到文档
|
||||
document.body.appendChild(element);
|
||||
}
|
@ -208,3 +208,8 @@
|
||||
#closeButtonLeft:hover {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
@keyframes blinkAnimation {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0; }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user