mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2026-09-21 05:20:38 +08:00
Extension背景页弃用
This commit is contained in:
@@ -185,12 +185,14 @@ async function beginInvoke(msg, ws) {
|
||||
socket_flowchart.send(msg.message.pipe); //直接把消息转接
|
||||
let message = JSON.parse(msg.message.pipe);
|
||||
let type = message.type;
|
||||
console.log("FROM Browser: ", message);
|
||||
// if(type.indexOf("Click")>=0){
|
||||
// await new Promise(resolve => setTimeout(resolve, 2000)); //等两秒
|
||||
//
|
||||
// }
|
||||
} else {
|
||||
socket_window.send(msg.message.pipe);
|
||||
console.log("FROM Flowchart: ", JSON.parse(msg.message.pipe));
|
||||
}
|
||||
} catch {
|
||||
dialog.showErrorBox("Error", "Please open the flowchart window first");
|
||||
@@ -240,6 +242,7 @@ let wss = new WebSocket.Server({port: websocket_port});
|
||||
wss.on('connection', function (ws) {
|
||||
ws.on('message', async function (message, isBinary) {
|
||||
let msg = JSON.parse(message.toString());
|
||||
console.log("\n\nGET A MESSAGE: ", msg);
|
||||
// console.log(msg, msg.type, msg.message);
|
||||
if (msg.type == 0) {
|
||||
if (msg.message.id == 0) {
|
||||
|
||||
@@ -225,14 +225,14 @@
|
||||
<option :value = 6>Webpage Title</option>
|
||||
<option :value = 7>Element Screenshot</option>
|
||||
<option :value = 8>OCR Results</option>
|
||||
<option :value = 9>The return value after executing JavaScript script on this element</option>
|
||||
<option :value = 9>The return value after executing JavaScript script on this element (start with 'return ')</option>
|
||||
<option :value = 10>Selected value of the current select box</option>
|
||||
<option :value = 11>Selected text of the current select box</option>
|
||||
</select>
|
||||
<div v-if='paras.parameters[paraIndex]["contentType"] == 9'>
|
||||
<label>JavaScript Code: </label>
|
||||
<textarea onkeydown="inputDelete(event)" class="form-control" rows="2"
|
||||
placeholder='The element can be represented by arguments[0]. Here is an example: return arguments[0].innerText + "US Dollar". This code extracts the innerText of the element and appends "US Dollar" to it.' v-model='paras.parameters[paraIndex]["JS"]'></textarea>
|
||||
placeholder='The element should be represented by arguments[0]. Here is an example: return arguments[0].innerText + "US Dollar". This code extracts the innerText of the element and appends "US Dollar" to it.' v-model='paras.parameters[paraIndex]["JS"]'></textarea>
|
||||
<label>Maximum wait time for script execution (0 represents unlimited wait time): </label>
|
||||
<input onkeydown="inputDelete(event)" required class="form-control" type="number" v-model.number='paras.parameters[paraIndex]["JSWaitTime"]'></input>
|
||||
</div>
|
||||
@@ -304,7 +304,7 @@
|
||||
<select v-model='nowNode["parameters"]["codeMode"]' class="form-control">
|
||||
<option value = 0>Execute JavaScript script</option>
|
||||
<option value = 1>Execute operating system-level command</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 2>Execute JavaScript script for the current element inside the loop.</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 2>Execute JavaScript script for the current element inside the loop</option>
|
||||
</select>
|
||||
|
||||
<div>
|
||||
@@ -365,7 +365,7 @@
|
||||
<option value = 2>Fixed Element List</option>
|
||||
<option value = 3>Text List</option>
|
||||
<option value = 4>Weblink List</option>
|
||||
<option value = 5>Return value of JavaScript command</option>
|
||||
<option value = 5>Return value of JavaScript command (start with 'return ')</option>
|
||||
<option value = 6>Return value of system command</option>
|
||||
</select>
|
||||
<div v-if='parseInt(loopType) < 2'>
|
||||
@@ -409,7 +409,7 @@
|
||||
<p><label>(Advanced Operation) Define loop exit condition using code/script:</label></p>
|
||||
<select v-model='nowNode["parameters"]["breakMode"]' class="form-control" style="font-weight: bold">
|
||||
<option value=0>Do not set script (even if a script is written below, it will not be executed)</option>
|
||||
<option value=1>JavaScript script</option>
|
||||
<option value=1>JavaScript script (start with 'return ')</option>
|
||||
<option value=2>Operating system-level command</option>
|
||||
</select>
|
||||
<div>
|
||||
@@ -423,7 +423,7 @@
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==9">
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==10">
|
||||
@@ -434,7 +434,7 @@
|
||||
<option value = 2>Element inside current page</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 3>Text inside current loop</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 4>Element inside current loop</option>
|
||||
<option value = 5>Return value of JavaScript command</option>
|
||||
<option value = 5>Return value of JavaScript command (start with 'return ')</option>
|
||||
<option value = 6>Return value of system command</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 7>Return value of JavaScript command for the current loop item</option>
|
||||
</select>
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
<option :value = 6>页面标题</option>
|
||||
<option :value = 7>元素截图</option>
|
||||
<option :value = 8>OCR识别文字</option>
|
||||
<option :value = 9>针对该元素的JavaScript代码返回值</option>
|
||||
<option :value = 9>针对该元素的JavaScript代码返回值(需以return 开头)</option>
|
||||
<option :value = 10>当前选择框选中的选项值</option>
|
||||
<option :value = 11>当前选择框选中的选项文本</option>
|
||||
</select>
|
||||
@@ -313,7 +313,7 @@
|
||||
<p style="margin-top: 15px">是否将执行后的输出/返回值作为字段记录:</p>
|
||||
<p><select v-model='nowNode["parameters"]["recordASField"]' class="form-control">
|
||||
<option value = 0>否</option>
|
||||
<option value = 1>是</option>
|
||||
<option value = 1>是(JavaScript脚本需要以return 开头)</option>
|
||||
</select></p>
|
||||
<label>最长等待脚本执行时间(0代表无限等待): </label>
|
||||
<input onkeydown="inputDelete(event)" required class="form-control" type="number" v-model.number='nowNode["parameters"]["waitTime"]'></input>
|
||||
@@ -365,7 +365,7 @@
|
||||
<option value = 2>固定元素列表</option>
|
||||
<option value = 3>文本列表(多用于循环在文本框输入文本)</option>
|
||||
<option value = 4>网址列表(多用于循环打开网页)</option>
|
||||
<option value = 5>JavaScript命令返回值</option>
|
||||
<option value = 5>JavaScript命令返回值(需以return 开头)</option>
|
||||
<option value = 6>系统命令返回值</option>
|
||||
</select>
|
||||
<div v-if='parseInt(loopType) < 2'>
|
||||
@@ -409,7 +409,7 @@
|
||||
<p><label>(高级操作)使用代码/脚本定义循环退出条件: </label></p>
|
||||
<select v-model='nowNode["parameters"]["breakMode"]' class="form-control" style="font-weight: bold">
|
||||
<option value = 0>不设置脚本(选择这个下面写了脚本也不会执行)</option>
|
||||
<option value = 1>JavaScript脚本</option>
|
||||
<option value = 1>JavaScript脚本返回值(需以return 开头)</option>
|
||||
<option value = 2>操作系统级别命令</option>
|
||||
</select>
|
||||
<div>
|
||||
@@ -423,7 +423,7 @@
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==9">
|
||||
|
||||
<label>判断条件是从左往右判断的,即如果最左边的判断分支的条件满足,则执行最左边分支内的操作,否则判断从左向右第二个分支的条件是否满足,以此类推。</label>
|
||||
</div>
|
||||
|
||||
<div class="elements" v-if="nodeType==10">
|
||||
@@ -434,9 +434,9 @@
|
||||
<option value = 2>当前页面包括元素</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 3>当前循环项包括文本</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 4>当前循环项包括元素</option>
|
||||
<option value = 5>JavaScript命令返回值</option>
|
||||
<option value = 5>JavaScript命令返回值(需以return 开头)</option>
|
||||
<option value = 6>系统命令返回值</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 7>针对当前循环项的JavaScript命令返回值</option>
|
||||
<option v-if="nowNode['isInLoop']" value = 7>针对当前循环项的JavaScript命令返回值(需以return 开头)</option>
|
||||
</select>
|
||||
<div v-if='TClass>0 && TClass <5'>
|
||||
<label>包含的文字/元素XPATH: <span style="font-size: 30px!important;" title="相对XPATH写法:以/开头,如循环项XPATH为/html/body/div[1],您的输入为/*[@id='tab-customer'],则最终寻址的xpath为:/html/body/div[1]/*[@id='tab-customer']">☺</span></label>
|
||||
|
||||
@@ -250,16 +250,16 @@
|
||||
},
|
||||
localExecuteInstant: function (with_user_data=false) {
|
||||
let text = "";
|
||||
if (getUrlParam("lang") == "en" || getUrlParam("lang") == "") {
|
||||
text = "Are you sure to run this task locally now?";
|
||||
} else {
|
||||
text = "确定要立即在本地运行此任务吗?";
|
||||
}
|
||||
// if (getUrlParam("lang") == "en" || getUrlParam("lang") == "") {
|
||||
// text = "Are you sure to run this task locally now?";
|
||||
// } else {
|
||||
// text = "确定要立即在本地运行此任务吗?";
|
||||
// }
|
||||
|
||||
this.with_user_data = with_user_data;
|
||||
if (confirm(text)) {
|
||||
var para = {};
|
||||
var t = $('#form').serializeArray();
|
||||
// if (confirm(text)) {
|
||||
let para = {};
|
||||
let t = $('#form').serializeArray();
|
||||
t.forEach(function (item, index) {
|
||||
para[item.name] = item.value;
|
||||
});
|
||||
@@ -282,7 +282,7 @@
|
||||
$('#myModal').modal('show');
|
||||
}
|
||||
});
|
||||
}
|
||||
// }
|
||||
},
|
||||
remoteExecuteInstant: function () {
|
||||
},
|
||||
|
||||
@@ -22,13 +22,17 @@
|
||||
<div style="margin:0 auto;min-width: 70%;" id="taskList">
|
||||
<h4 style="text-align: center;">{{"Task List~任务列表" | lang}}</h4>
|
||||
<p><a v-if="type==3" href="javascript:void(0)" v-on:click="newTask" class="btn btn-primary">{{"New Task~创建新任务" | lang}}</a></p>
|
||||
<div v-if="type != 3" style="margin-bottom: 20px">
|
||||
<a class="btn btn-primary" href="https://github.com/NaiboWang/EasySpider/issues/22" target="_blank">{{"How to run task by schedule~定时执行任务教程" | lang}}</a>
|
||||
<a class="btn btn-primary" href="" target="_blank">{{"How to run task by schedule~定时执行任务教程" | lang}}</a>
|
||||
</div>
|
||||
<div style="margin-bottom: 10px">
|
||||
<table style="table-layout: auto;" class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left">No.</th>
|
||||
<th style="text-align: center">{{"Task Name~任务名称" | lang}}</th>
|
||||
<th>网址</th>
|
||||
<th>{{"URL~网址" | lang}}</th>
|
||||
<th v-bind:colspan="type" style="min-width: 300px">{{"Operations~操作" | lang}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"id":74,"name":"Electronics, Cars, Fashion, Collectibles & More | eBay","url":"https://www.ebay.com","links":"https://www.ebay.com","create_time":"5/26/2023, 12:07:26 AM","version":"0.3.1","containJudge":false,"desc":"https://www.ebay.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"Open Page","value":"https://www.ebay.com","desc":"List of URLs to be collected, separated by \\n for multiple lines","type":"string","exampleValue":"https://www.ebay.com"}],"outputParameters":[],"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":"Open Page","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://www.ebay.com","links":"https://www.ebay.com","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1}},{"id":2,"index":2,"parentId":0,"type":0,"option":7,"title":"Mouse Move","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[contains(@class, \"hl-ad-row__text-wrapper\")]/div[3]/div[2]","wait":7,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"allXPaths":["/html/body/div[6]/div[7]/a[1]/div[2]/div[2]/div[3]/div[2]","//div[contains(., 'Get your t')]","//DIV[@class='hl-cta__default hl-cta__default-js hl-ad-row__cta-button hl-ad-row__cta']"]}}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"id":75,"name":"京东全球版-专业的综合网上购物商城","url":"https://www.jd.com","links":"https://www.jd.com","create_time":"5/26/2023, 12:09:11 AM","version":"0.3.1","containJudge":false,"desc":"https://www.jd.com","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"Open Page","value":"https://www.jd.com","desc":"List of URLs to be collected, separated by \\n for multiple lines","type":"string","exampleValue":"https://www.jd.com"}],"outputParameters":[],"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":"Open Page","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":"Loop","sequence":[3,4],"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":""}},{"id":3,"index":3,"parentId":2,"type":0,"option":7,"title":"Mouse Move","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"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,"allXPaths":"","loopType":1}},{"id":4,"index":4,"parentId":2,"type":0,"option":2,"title":"Click Element","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":true,"xpath":"//*[contains(@class, \"LeftSide_menu_list__qXCeM\")]/div[1]","wait":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"maxWaitTime":10,"paras":[],"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 ']"]}}]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user