mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-23 01:29:20 +08:00
Update Sample, fix bug
This commit is contained in:
parent
72a7e9f922
commit
9c3675ac2d
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":"/Users/naibowang/Documents/EasySpider/ElectronJS/user_data"}
|
||||
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data"}
|
@ -245,7 +245,7 @@
|
||||
<option :value = 4>Image Address</option>
|
||||
</select>
|
||||
<div v-if='paras.parameters[paraIndex]["nodeType"] == 4'>
|
||||
<label>Whether to <b>download image</b> after extracting the image address</label>
|
||||
<label>Whether to <b>download image</b> after extracting the image address: </label>
|
||||
<select v-model='paras.parameters[paraIndex]["downloadPic"]' class="form-control">
|
||||
<option :value = 0>No</option>
|
||||
<option :value = 1>Yes</option>
|
||||
@ -427,6 +427,7 @@
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==10">
|
||||
<label>The conditions are evaluated from left to right, which means if the condition in the leftmost branch is satisfied, the operations within that branch are executed. Otherwise, the condition in the next branch from left to right is evaluated, and so on.</label>
|
||||
<label>Condition Type:</label>
|
||||
<select v-model='TClass' class="form-control">
|
||||
<option value = 0>No Condition</option>
|
||||
|
@ -1,6 +1,6 @@
|
||||
//处理表现层
|
||||
var nodeList = Array(); //所有新生成的节点全部存储在这里,并且有唯一索引号,所有的定位均通过index进行,即将图保存下来了
|
||||
var root = {
|
||||
let nodeList = Array(); //所有新生成的节点全部存储在这里,并且有唯一索引号,所有的定位均通过index进行,即将图保存下来了
|
||||
let root = {
|
||||
index: 0, //在nodeList中的索引号
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -18,16 +18,16 @@ var root = {
|
||||
isInLoop: false, //是否处于循环内
|
||||
};
|
||||
nodeList.push(root);
|
||||
var queue = new Array();
|
||||
var actionSequence = new Array(); //存储图结构,每个元素为在nodelist里面的索引值,下面的id和pid根据此数组进行索引,然后再在nodelist里找
|
||||
var nowNode = null; //存储现在所在的节点
|
||||
var vueData = { nowNodeIndex: 0 }; //存储目前所在节点的索引号,不能直接使用变量而需要用对象包起来
|
||||
var option = 0; //工具箱选项
|
||||
var title = "";
|
||||
var parameterNum = 1; //记录目前的参数个数
|
||||
let queue = new Array();
|
||||
let actionSequence = new Array(); //存储图结构,每个元素为在nodelist里面的索引值,下面的id和pid根据此数组进行索引,然后再在nodelist里找
|
||||
let nowNode = null; //存储现在所在的节点
|
||||
let vueData = { nowNodeIndex: 0 }; //存储目前所在节点的索引号,不能直接使用变量而需要用对象包起来
|
||||
let option = 0; //工具箱选项
|
||||
let title = "";
|
||||
let parameterNum = 1; //记录目前的参数个数
|
||||
|
||||
//处理逻辑层
|
||||
var app = new Vue({
|
||||
let app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
list: { nl: nodeList },
|
||||
@ -166,8 +166,8 @@ var app = new Vue({
|
||||
//深复制
|
||||
function DeepClone(obj) {
|
||||
if (obj === null || typeof obj !== 'object') return obj;
|
||||
var cpObj = obj instanceof Array ? [] : {};
|
||||
for (var key in obj) cpObj[key] = DeepClone(obj[key]);
|
||||
let cpObj = obj instanceof Array ? [] : {};
|
||||
for (let key in obj) cpObj[key] = DeepClone(obj[key]);
|
||||
return cpObj;
|
||||
}
|
||||
|
||||
@ -227,8 +227,8 @@ function branchMouseDown(e) {
|
||||
if (e.button == 2) //右键点击
|
||||
{
|
||||
let judgeId = this.getAttribute('data');
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
index: l,
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -260,8 +260,8 @@ function arrowMouseDown(e) {
|
||||
//增加分支点击事件
|
||||
function branchClick(e) {
|
||||
let judgeId = this.getAttribute('data');
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
index: l,
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -305,7 +305,8 @@ function addElement(op, para) {
|
||||
option = op;
|
||||
if (option == 1) { //打开网页选项
|
||||
title = "Open Page";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
title = $(".options")[option - 1].innerHTML; //获取新增操作名称
|
||||
}
|
||||
|
||||
@ -327,13 +328,13 @@ function toolBoxKernel(e, para = null) {
|
||||
} else {
|
||||
let position = parseInt(nowNode.getAttribute('position'));
|
||||
let pId = nowNode.getAttribute('pId');
|
||||
var tt = nodeList[nodeList[actionSequence[pId]]["sequence"][position]]; //在相应位置添加新元素
|
||||
let tt = nodeList[nodeList[actionSequence[pId]]["sequence"][position]]; //在相应位置添加新元素
|
||||
t = DeepClone(tt); //浅复制元素
|
||||
var l = nodeList.length;
|
||||
let l = nodeList.length;
|
||||
t.index = l;
|
||||
nodeList.push(t);
|
||||
var position2 = parseInt(app._data.nowArrow['position']);
|
||||
var pId2 = app._data.nowArrow['pId'];
|
||||
let position2 = parseInt(app._data.nowArrow['position']);
|
||||
let pId2 = app._data.nowArrow['pId'];
|
||||
nodeList[actionSequence[pId2]]["sequence"].splice(position2 + 1, 0, t.index); //在相应位置添加新元素
|
||||
refresh(); //重新渲染页面
|
||||
app._data.nowArrow = { "position": t["position"], "pId": t["parentId"], "num": 0 };
|
||||
@ -349,11 +350,11 @@ function toolBoxKernel(e, para = null) {
|
||||
} else {
|
||||
let position = parseInt(nowNode.getAttribute('position'));
|
||||
let pId = nowNode.getAttribute('pId');
|
||||
var position2 = parseInt(app._data.nowArrow['position']);
|
||||
var pId2 = app._data.nowArrow['pId'];
|
||||
var id = nowNode.getAttribute('data');
|
||||
var pidt = pId2;
|
||||
var move = true;
|
||||
let position2 = parseInt(app._data.nowArrow['position']);
|
||||
let pId2 = app._data.nowArrow['pId'];
|
||||
let id = nowNode.getAttribute('data');
|
||||
let pidt = pId2;
|
||||
let move = true;
|
||||
console.log(pidt, id);
|
||||
while (pidt != 0) {
|
||||
if (pidt == id) {
|
||||
@ -381,8 +382,8 @@ function toolBoxKernel(e, para = null) {
|
||||
e.stopPropagation(); //防止冒泡
|
||||
}
|
||||
} else if (option > 0) { //新增操作
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
id: 0,
|
||||
index: l,
|
||||
parentId: 0,
|
||||
@ -400,7 +401,7 @@ function toolBoxKernel(e, para = null) {
|
||||
{
|
||||
t["type"] = 2;
|
||||
// 增加两个分支
|
||||
var nt = {
|
||||
let nt = {
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
index: l + 1,
|
||||
@ -410,7 +411,7 @@ function toolBoxKernel(e, para = null) {
|
||||
sequence: [],
|
||||
isInLoop: false,
|
||||
};
|
||||
var nt2 = {
|
||||
let nt2 = {
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
index: l + 2,
|
||||
@ -503,12 +504,12 @@ function refresh(nowArrowReset = true) {
|
||||
<p id="firstArrow" class="arrow" position=-1 pId=0>↓</p>`);
|
||||
actionSequence.splice(0);
|
||||
queue.splice(0);
|
||||
var idd = 1;
|
||||
let idd = 1;
|
||||
queue.push(0);
|
||||
actionSequence.push(0);
|
||||
while (queue.length != 0) {
|
||||
var nd = queue.shift(); //取出父元素并建立对子元素的链接
|
||||
for (i = 0; i < nodeList[nd].sequence.length; i++) {
|
||||
let nd = queue.shift(); //取出父元素并建立对子元素的链接
|
||||
for (let i = 0; i < nodeList[nd].sequence.length; i++) {
|
||||
nodeList[nodeList[nd].sequence[i]].parentId = nodeList[nd].id;
|
||||
nodeList[nodeList[nd].sequence[i]]["position"] = i;
|
||||
nodeList[nodeList[nd].sequence[i]].id = idd++;
|
||||
@ -524,11 +525,11 @@ function refresh(nowArrowReset = true) {
|
||||
}
|
||||
if (nowArrowReset) //如果要重置锚点位置
|
||||
{
|
||||
app._data.nowArrow = { "position": -1, "pId": 0, "num": 0 }; //设置默认要添加的位置是元素流程最开头处
|
||||
app._data.nowArrow = { "position": nodeList[0].sequence.length - 1, "pId": 0, "num": 0 }; //设置默认要添加的位置是元素流程最开头处
|
||||
}
|
||||
//第一个元素不渲染
|
||||
for (i = 1; i < actionSequence.length; i++) {
|
||||
parentId = nodeList[actionSequence[i]]["parentId"];
|
||||
for (let i = 1; i < actionSequence.length; i++) {
|
||||
let parentId = nodeList[actionSequence[i]]["parentId"];
|
||||
$("#" + parentId).append(newNode(nodeList[actionSequence[i]]));
|
||||
}
|
||||
bindEvents();
|
||||
|
@ -245,7 +245,7 @@
|
||||
<option :value = 4>图片地址</option>
|
||||
</select>
|
||||
<div v-if='paras.parameters[paraIndex]["nodeType"] == 4'>
|
||||
<label>提取图片地址后是否同时<b>下载图片</b></label>
|
||||
<label>提取图片地址后是否同时<b>下载图片</b>:</label>
|
||||
<select v-model='paras.parameters[paraIndex]["downloadPic"]' class="form-control">
|
||||
<option :value = 0>否</option>
|
||||
<option :value = 1>是</option>
|
||||
@ -427,6 +427,7 @@
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==10">
|
||||
<label>判断条件是从左往右判断的,即如果最左边的判断分支的条件满足,则执行最左边分支内的操作,否则判断从左向右第二个分支的条件是否满足,以此类推。</label>
|
||||
<label>条件类型:</label>
|
||||
<select v-model='TClass' class="form-control">
|
||||
<option value = 0>无条件</option>
|
||||
|
@ -1,6 +1,6 @@
|
||||
//处理表现层
|
||||
var nodeList = Array(); //所有新生成的节点全部存储在这里,并且有唯一索引号,所有的定位均通过index进行,即将图保存下来了
|
||||
var root = {
|
||||
let nodeList = Array(); //所有新生成的节点全部存储在这里,并且有唯一索引号,所有的定位均通过index进行,即将图保存下来了
|
||||
let root = {
|
||||
index: 0, //在nodeList中的索引号
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -18,16 +18,16 @@ var root = {
|
||||
isInLoop: false, //是否处于循环内
|
||||
};
|
||||
nodeList.push(root);
|
||||
var queue = new Array();
|
||||
var actionSequence = new Array(); //存储图结构,每个元素为在nodelist里面的索引值,下面的id和pid根据此数组进行索引,然后再在nodelist里找
|
||||
var nowNode = null; //存储现在所在的节点
|
||||
var vueData = { nowNodeIndex: 0 }; //存储目前所在节点的索引号,不能直接使用变量而需要用对象包起来
|
||||
var option = 0; //工具箱选项
|
||||
var title = "";
|
||||
var parameterNum = 1; //记录目前的参数个数
|
||||
let queue = new Array();
|
||||
let actionSequence = new Array(); //存储图结构,每个元素为在nodelist里面的索引值,下面的id和pid根据此数组进行索引,然后再在nodelist里找
|
||||
let nowNode = null; //存储现在所在的节点
|
||||
let vueData = { nowNodeIndex: 0 }; //存储目前所在节点的索引号,不能直接使用变量而需要用对象包起来
|
||||
let option = 0; //工具箱选项
|
||||
let title = "";
|
||||
let parameterNum = 1; //记录目前的参数个数
|
||||
|
||||
//处理逻辑层
|
||||
var app = new Vue({
|
||||
let app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
list: { nl: nodeList },
|
||||
@ -167,8 +167,8 @@ var app = new Vue({
|
||||
//深复制
|
||||
function DeepClone(obj) {
|
||||
if (obj === null || typeof obj !== 'object') return obj;
|
||||
var cpObj = obj instanceof Array ? [] : {};
|
||||
for (var key in obj) cpObj[key] = DeepClone(obj[key]);
|
||||
let cpObj = obj instanceof Array ? [] : {};
|
||||
for (let key in obj) cpObj[key] = DeepClone(obj[key]);
|
||||
return cpObj;
|
||||
}
|
||||
|
||||
@ -228,8 +228,8 @@ function branchMouseDown(e) {
|
||||
if (e.button == 2) //右键点击
|
||||
{
|
||||
let judgeId = this.getAttribute('data');
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
index: l,
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -261,8 +261,8 @@ function arrowMouseDown(e) {
|
||||
//增加分支点击事件
|
||||
function branchClick(e) {
|
||||
let judgeId = this.getAttribute('data');
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
index: l,
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
@ -328,13 +328,13 @@ function toolBoxKernel(e, para = null) {
|
||||
} else {
|
||||
let position = parseInt(nowNode.getAttribute('position'));
|
||||
let pId = nowNode.getAttribute('pId');
|
||||
var tt = nodeList[nodeList[actionSequence[pId]]["sequence"][position]]; //在相应位置添加新元素
|
||||
let tt = nodeList[nodeList[actionSequence[pId]]["sequence"][position]]; //在相应位置添加新元素
|
||||
t = DeepClone(tt); //浅复制元素
|
||||
var l = nodeList.length;
|
||||
let l = nodeList.length;
|
||||
t.index = l;
|
||||
nodeList.push(t);
|
||||
var position2 = parseInt(app._data.nowArrow['position']);
|
||||
var pId2 = app._data.nowArrow['pId'];
|
||||
let position2 = parseInt(app._data.nowArrow['position']);
|
||||
let pId2 = app._data.nowArrow['pId'];
|
||||
nodeList[actionSequence[pId2]]["sequence"].splice(position2 + 1, 0, t.index); //在相应位置添加新元素
|
||||
refresh(); //重新渲染页面
|
||||
app._data.nowArrow = { "position": t["position"], "pId": t["parentId"], "num": 0 };
|
||||
@ -350,11 +350,11 @@ function toolBoxKernel(e, para = null) {
|
||||
} else {
|
||||
let position = parseInt(nowNode.getAttribute('position'));
|
||||
let pId = nowNode.getAttribute('pId');
|
||||
var position2 = parseInt(app._data.nowArrow['position']);
|
||||
var pId2 = app._data.nowArrow['pId'];
|
||||
var id = nowNode.getAttribute('data');
|
||||
var pidt = pId2;
|
||||
var move = true;
|
||||
let position2 = parseInt(app._data.nowArrow['position']);
|
||||
let pId2 = app._data.nowArrow['pId'];
|
||||
let id = nowNode.getAttribute('data');
|
||||
let pidt = pId2;
|
||||
let move = true;
|
||||
console.log(pidt, id);
|
||||
while (pidt != 0) {
|
||||
if (pidt == id) {
|
||||
@ -382,8 +382,8 @@ function toolBoxKernel(e, para = null) {
|
||||
e.stopPropagation(); //防止冒泡
|
||||
}
|
||||
} else if (option > 0) { //新增操作
|
||||
var l = nodeList.length;
|
||||
var t = {
|
||||
let l = nodeList.length;
|
||||
let t = {
|
||||
id: 0,
|
||||
index: l,
|
||||
parentId: 0,
|
||||
@ -401,7 +401,7 @@ function toolBoxKernel(e, para = null) {
|
||||
{
|
||||
t["type"] = 2;
|
||||
// 增加两个分支
|
||||
var nt = {
|
||||
let nt = {
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
index: l + 1,
|
||||
@ -411,7 +411,7 @@ function toolBoxKernel(e, para = null) {
|
||||
sequence: [],
|
||||
isInLoop: false,
|
||||
};
|
||||
var nt2 = {
|
||||
let nt2 = {
|
||||
id: 0,
|
||||
parentId: 0,
|
||||
index: l + 2,
|
||||
@ -504,12 +504,12 @@ function refresh(nowArrowReset = true) {
|
||||
<p id="firstArrow" class="arrow" position=-1 pId=0>↓</p>`);
|
||||
actionSequence.splice(0);
|
||||
queue.splice(0);
|
||||
var idd = 1;
|
||||
let idd = 1;
|
||||
queue.push(0);
|
||||
actionSequence.push(0);
|
||||
while (queue.length != 0) {
|
||||
var nd = queue.shift(); //取出父元素并建立对子元素的链接
|
||||
for (i = 0; i < nodeList[nd].sequence.length; i++) {
|
||||
let nd = queue.shift(); //取出父元素并建立对子元素的链接
|
||||
for (let i = 0; i < nodeList[nd].sequence.length; i++) {
|
||||
nodeList[nodeList[nd].sequence[i]].parentId = nodeList[nd].id;
|
||||
nodeList[nodeList[nd].sequence[i]]["position"] = i;
|
||||
nodeList[nodeList[nd].sequence[i]].id = idd++;
|
||||
@ -525,11 +525,11 @@ function refresh(nowArrowReset = true) {
|
||||
}
|
||||
if (nowArrowReset) //如果要重置锚点位置
|
||||
{
|
||||
app._data.nowArrow = { "position": -1, "pId": 0, "num": 0 }; //设置默认要添加的位置是元素流程最开头处
|
||||
app._data.nowArrow = { "position": nodeList[0].sequence.length - 1, "pId": 0, "num": 0 }; //设置默认要添加的位置是元素流程最开头处
|
||||
}
|
||||
//第一个元素不渲染
|
||||
for (i = 1; i < actionSequence.length; i++) {
|
||||
parentId = nodeList[actionSequence[i]]["parentId"];
|
||||
for (let i = 1; i < actionSequence.length; i++) {
|
||||
let parentId = nodeList[actionSequence[i]]["parentId"];
|
||||
$("#" + parentId).append(newNode(nodeList[actionSequence[i]]));
|
||||
}
|
||||
bindEvents();
|
||||
|
@ -47,9 +47,10 @@
|
||||
<p>{{"Task Name:~任务名称:" | lang}} {{task["name"]}}</p>
|
||||
<p style="word-wrap: break-word;word-break: break-all;overflow: hidden;max-height: 100px;">{{"Task Description:~任务描述:" | lang}} {{task["desc"]}}</p>
|
||||
<p style="word-wrap: break-word;word-break: break-all;overflow: hidden;max-height: 100px;">{{"Example URL:~样例网址:" | lang}} {{task["url"]}}</p>
|
||||
<p>{{"Operations (Please close this window and select 'Design Task' button if you want to modify task with a browser)~操作(如要带浏览器修改任务流程请关闭此窗口并选择设计任务)" | lang}}</p>
|
||||
<p><a style="margin-top: 5px;" href="javascript:void(0)" v-on:click="modifyTask(task['id'],task['url'])" class="btn btn-primary">{{"Modify Task Workflow~修改任务流程" | lang}}</a>
|
||||
<a style="margin-top: 5px;" href="javascript:void(0)" v-on:click="invokeTask(task['id'],task['url'])" class="btn btn-primary">{{"Invoke Task~调用任务" | lang}}</a></p>
|
||||
<p>{{"Input Parameters:~输入参数:" | lang}}</p>
|
||||
<a style="margin-top: 5px;" href="javascript:void(0)" v-on:click="invokeTask(task['id'],task['url'])" class="btn btn-primary">{{"Invoke Task~调用任务" | lang}}</a></p>
|
||||
<p>{{"Input Parameters~输入参数" | lang}}</p>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
@ -78,7 +79,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>{{"Output Parameters:~输出参数:" | lang}}</p>
|
||||
<p>{{"Output Parameters~输出参数" | lang}}</p>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
1
ElectronJS/tasks/86.json
Normal file
1
ElectronJS/tasks/86.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/87.json
Normal file
1
ElectronJS/tasks/87.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/88.json
Normal file
1
ElectronJS/tasks/88.json
Normal file
@ -0,0 +1 @@
|
||||
{"id":88,"name":"选中子元素(测试C)","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"5/31/2023, 9:04:57 PM","version":"0.3.2","containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.jd.com","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.jd.com"}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"/"},{"id":1,"name":"参数2_链接文本","desc":"","type":"string","exampleValue":"手机"},{"id":2,"name":"参数3_链接地址","desc":"","type":"string","exampleValue":"https://shouji.jd.com/"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":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,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.jd.com","links":"https://www.jd.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":1,"option":8,"title":"循环","sequence":[3],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":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[5]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]","//div[contains(., '/手机/数码')]","//DIV[@class='LeftSide_menu_item__SBMWC LeftSide_text_space__2UhbG ']"]}},{"id":3,"index":3,"parentId":2,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":1,"relative":true,"name":"参数1_文本","desc":"","relativeXPath":"/span[1]","allXPaths":["/span[1]","//span[contains(., '/')]","//SPAN[@class='LeftSide_cate_menu_line__vzQu9 LeftSide_fore0__r2Yrl']"],"exampleValues":[{"num":0,"value":"/"},{"num":1,"value":"/"},{"num":2,"value":"/"},{"num":3,"value":"/"},{"num":4,"value":"/"},{"num":5,"value":"/"},{"num":6,"value":"/"},{"num":7,"value":"/"},{"num":8,"value":"/"},{"num":9,"value":"/"},{"num":10,"value":"/"},{"num":11,"value":"/"},{"num":12,"value":"/"}],"unique_index":"/span[1]","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0},{"nodeType":1,"contentType":0,"relative":true,"name":"参数2_链接文本","desc":"","relativeXPath":"/a[1]","allXPaths":["/a[1]","//a[contains(., '手机')]"],"exampleValues":[{"num":0,"value":"手机"},{"num":1,"value":"家用电器"},{"num":2,"value":"电脑"},{"num":3,"value":"家纺"},{"num":4,"value":"家具"},{"num":5,"value":"内衣"},{"num":6,"value":"箱包"},{"num":7,"value":"运动"},{"num":8,"value":"汽车用品"},{"num":9,"value":"母婴"},{"num":10,"value":"玩具乐器"},{"num":11,"value":"家庭清洁"},{"num":12,"value":"图书"}],"unique_index":"/a[1]","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0},{"nodeType":2,"contentType":0,"relative":true,"name":"参数3_链接地址","desc":"","relativeXPath":"/a[1]","allXPaths":["/a[1]","//a[contains(., '手机')]"],"exampleValues":[{"num":0,"value":"https://shouji.jd.com/"},{"num":1,"value":"https://search.jd.com/Search?keyword=%E5%B0%8F%E5%AE%B6%E7%94%B5&enc=utf-8&wq=%E5%B0%8F%E5%AE%B6%E7%94%B5&pvid=261a350161304c979fa0e7ce95c05671"},{"num":2,"value":"https://diannao.jd.com/"},{"num":3,"value":"https://channel.jd.com/jf.html"},{"num":4,"value":"https://channel.jd.com/furniture.html"},{"num":5,"value":"https://channel.jd.com/underwear.html"},{"num":6,"value":"https://channel.jd.com/bag.html"},{"num":7,"value":"https://phat.jd.com/10-109.html"},{"num":8,"value":"https://che.jd.com/"},{"num":9,"value":"https://search.jd.com/Search?keyword=%E6%AF%8D%E5%A9%B4&enc=utf-8&qrst=1&rt=1&stop=1&vt=2&wq=%E6%AF%8D%E5%A9%B4&stock=1&gp=2&click=1"},{"num":10,"value":"https://toy.jd.com/"},{"num":11,"value":"https://channel.jd.com/beauty.html"},{"num":12,"value":"https://book.jd.com/"}],"unique_index":"/a[1]","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}],"loopType":1}}]}
|
1
ElectronJS/tasks/89.json
Normal file
1
ElectronJS/tasks/89.json
Normal file
@ -0,0 +1 @@
|
||||
{"id":89,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"5/31/2023, 9:29:28 PM","version":"0.3.2","containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://www.jd.com","desc":"要采集的网址列表,多行以\\n分开","type":"string","exampleValue":"https://www.jd.com"}],"outputParameters":[{"id":0,"name":"参数1_文本","desc":"","type":"string","exampleValue":"平板電腦爆款耳機手機數據線年貨節"},{"id":1,"name":"参数3_链接文本","desc":"","type":"string","exampleValue":"微波炉"},{"id":2,"name":"参数4_链接地址","desc":"","type":"string","exampleValue":"https://list.jd.com/list.html?cat=737,752,758"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2],"parameters":{"history":1,"tabIndex":0,"useLoop":false,"xpath":"","wait":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,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.jd.com","links":"https://www.jd.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"参数1_文本","desc":"","relativeXPath":"/html/body/div[5]/div[1]/div[4]","allXPaths":["/html/body/div[5]/div[1]/div[4]","//div[contains(., '平板電腦爆款耳機手機')]","id(\"hotwords\")"],"exampleValues":[{"num":0,"value":"平板電腦爆款耳機手機數據線年貨節"}],"unique_index":"xkp0xwz6sdjlibqupoj","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0},{"nodeType":1,"contentType":0,"relative":false,"name":"参数3_链接文本","desc":"","relativeXPath":"/html/body/div[6]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/a[28]","allXPaths":["/html/body/div[6]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/a[28]","//a[contains(., '微波炉')]","//A[@class='LeftSide_cate_sub_link__jYS4p']"],"exampleValues":[{"num":0,"value":"微波炉"}],"unique_index":"r068bzh2tidlibqupoj","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0},{"nodeType":2,"contentType":0,"relative":false,"name":"参数4_链接地址","desc":"","relativeXPath":"/html/body/div[6]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/a[28]","allXPaths":["/html/body/div[6]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/a[28]","//a[contains(., '微波炉')]","//A[@class='LeftSide_cate_sub_link__jYS4p']"],"exampleValues":[{"num":0,"value":"https://list.jd.com/list.html?cat=737,752,758"}],"unique_index":"r068bzh2tidlibqupoj","default":"","beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]}
|
1
ElectronJS/tasks/90.json
Normal file
1
ElectronJS/tasks/90.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/91.json
Normal file
1
ElectronJS/tasks/91.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/92.json
Normal file
1
ElectronJS/tasks/92.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/93.json
Normal file
1
ElectronJS/tasks/93.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/94.json
Normal file
1
ElectronJS/tasks/94.json
Normal file
File diff suppressed because one or more lines are too long
1
ElectronJS/tasks/95.json
Normal file
1
ElectronJS/tasks/95.json
Normal file
File diff suppressed because one or more lines are too long
1
Examples/汽车新闻采集/第一步:采集列表超链接地址.json
Normal file
1
Examples/汽车新闻采集/第一步:采集列表超链接地址.json
Normal file
File diff suppressed because one or more lines are too long
1
Examples/汽车新闻采集/第二步:采集详情页标题内容并下载所有图片.json
Normal file
1
Examples/汽车新闻采集/第二步:采集详情页标题内容并下载所有图片.json
Normal file
File diff suppressed because one or more lines are too long
@ -49,10 +49,10 @@ def download_image(url, save_directory):
|
||||
# 检查响应状态码是否为成功状态
|
||||
if response.status_code == requests.codes.ok:
|
||||
# 提取文件名
|
||||
file_name = url.split('/')[-1]
|
||||
file_name = url.split('/')[-1].split("?")[0]
|
||||
|
||||
# 生成唯一的新文件名
|
||||
new_file_name = str(uuid.uuid4()) + '_' + file_name
|
||||
new_file_name = file_name + '_' + str(uuid.uuid4()) + '_' + file_name
|
||||
|
||||
# 构建保存路径
|
||||
save_path = os.path.join(save_directory, new_file_name)
|
||||
|
@ -1 +1 @@
|
||||
{"language":"en"}
|
||||
{"language":"zh"}
|
Loading…
x
Reference in New Issue
Block a user