mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-21 23:05:22 +08:00
0.3.6 PRE
This commit is contained in:
parent
2c54cf5c02
commit
adde8d727e
@ -0,0 +1 @@
|
|||||||
|
{"id":3,"name":"Just a moment...","url":"https://portal.ustraveldocs.com/scheduleappointment","links":"https://portal.ustraveldocs.com/scheduleappointment","create_time":"7/12/2023, 11:21:54 AM","update_time":"7/12/2023, 11:23:01 AM","version":"0.3.5","saveThreshold":10,"cloudflare":1,"environment":0,"maxViewLength":15,"outputFormat":"xlsx","saveName":"current_time","containJudge":false,"desc":"https://portal.ustraveldocs.com/scheduleappointment","inputParameters":[{"id":0,"name":"urlList_0","nodeId":1,"nodeName":"打开网页","value":"https://portal.ustraveldocs.com/scheduleappointment","desc":"要采集的网址列表,多行以\\n分开","type":"text","exampleValue":"https://portal.ustraveldocs.com/scheduleappointment"}],"outputParameters":[{"id":0,"name":"参数2_文本","desc":"","type":"text","recordASField":1,"exampleValue":"\n 使用条款及细则 (Terms & Conditions)\n \n 在本网站所支付的所有费用均不予退还。请确保您已付款,并获得了收据号码。\n 签证不能保证进入美国。\n 签证允许外国公民进入美国口岸并提出入境申请。\n 只有美国国土安全部和美国海关与边境保护局(CBP)官员可以决定签证持有人能否入境。\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":"","wait":0,"waitType":0},"isInLoop":false},{"id":1,"index":1,"parentId":0,"type":0,"option":1,"title":"打开网页","sequence":[],"isInLoop":false,"position":0,"parameters":{"useLoop":false,"xpath":"","wait":15,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"url":"https://portal.ustraveldocs.com/scheduleappointment","links":"https://portal.ustraveldocs.com/scheduleappointment","maxWaitTime":10,"scrollType":0,"scrollCount":1,"scrollWaitTime":1,"cookies":""}},{"id":2,"index":2,"parentId":0,"type":0,"option":3,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":3,"tabIndex":-1,"useLoop":false,"xpath":"","iframe":false,"wait":0,"waitType":0,"beforeJS":"","beforeJSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"paras":[{"nodeType":0,"contentType":0,"relative":false,"name":"参数2_文本","desc":"","extractType":0,"relativeXPath":"/html/body/div[1]/div[1]/div[1]/form[1]/span[1]/div[1]","allXPaths":["/html/body/div[1]/div[1]/div[1]/form[1]/span[1]/div[1]","//div[contains(., '使')]","//DIV[@class='span-6 last']","/html/body/div[last()-5]/div/div/form/span/div"],"exampleValues":[{"num":0,"value":"\n 使用条款及细则 (Terms & Conditions)\n \n 在本网站所支付的所有费用均不予退还。请确保您已付款,并获得了收据号码。\n 签证不能保证进入美国。\n 签证允许外国公民进入美国口岸并提出入境申请。\n 只有美国国土安全部和美国海关与边境保护局(CBP)官员可以决定签证持有人能否入境。\n 您不能使用过期签证进入美国。当您进入美国时签证必须是有效的。\n \n "}],"unique_index":"p3h5p8qfeyljz5n60b","iframe":false,"default":"","paraType":"text","recordASField":1,"beforeJS":"","beforeJSWaitTime":0,"JS":"","JSWaitTime":0,"afterJS":"","afterJSWaitTime":0,"downloadPic":0}]}}]}
|
@ -50,7 +50,7 @@ def compress_folder_to_7z_split(folder_path, output_file):
|
|||||||
except:
|
except:
|
||||||
subprocess.call(["7zz", "a", "-v95m", output_file, folder_path])
|
subprocess.call(["7zz", "a", "-v95m", output_file, folder_path])
|
||||||
|
|
||||||
easyspider_version = "0.3.5"
|
easyspider_version = "0.3.6"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "easy-spider",
|
"name": "easy-spider",
|
||||||
"productName": "EasySpider",
|
"productName": "EasySpider",
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
"icon": "./favicon",
|
"icon": "./favicon",
|
||||||
"description": "NoCode Visual Web Crawler",
|
"description": "NoCode Visual Web Crawler",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
@ -66,7 +66,7 @@
|
|||||||
],
|
],
|
||||||
"packagerConfig": {
|
"packagerConfig": {
|
||||||
"icon": "./favicon",
|
"icon": "./favicon",
|
||||||
"appVersion": "0.3.5",
|
"appVersion": "0.3.6",
|
||||||
"name": "EasySpider",
|
"name": "EasySpider",
|
||||||
"executableName": "EasySpider",
|
"executableName": "EasySpider",
|
||||||
"appCopyright": "Naibo Wang (naibowang@foxmail.com)",
|
"appCopyright": "Naibo Wang (naibowang@foxmail.com)",
|
||||||
|
@ -1,203 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<script src="js/jquery-3.4.1.min.js"></script>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
|
||||||
name="viewport">
|
|
||||||
<meta content="ie=edge" http-equiv="X-UA-Compatible">
|
|
||||||
<script src="js/vue.global.js"></script>
|
|
||||||
<!-- <script src="https://unpkg.com/vue-i18n@9"></script> -->
|
|
||||||
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
|
|
||||||
</link>
|
|
||||||
<title>EasySpider: NoCode Visual Web Crawler</title>
|
|
||||||
</head>
|
|
||||||
<style>
|
|
||||||
.img-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img-container img {
|
|
||||||
/*max-width: 50%;*/
|
|
||||||
height: 75px;
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 10px; /* 可根据需要调整图片之间的间距 */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<body>
|
|
||||||
<div id="app">
|
|
||||||
|
|
||||||
<div style="padding: 10px; text-align: center;vertical-align: middle;" v-if="init">
|
|
||||||
<h5 style="margin-top: 20px">选择语言/Select Language</h5>
|
|
||||||
|
|
||||||
<p><a @click="changeLang('zh')" class="btn btn-outline-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">中文</a></p>
|
|
||||||
|
|
||||||
<p><a @click="changeLang('en')" class="btn btn-outline-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">English</a></p>
|
|
||||||
<p style="font-size: 17px">当前版本/Current Version: <b>v0.3.5</b></p>
|
|
||||||
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases" target="_blank">Github</a>最新版本/Newest Version:<b>{{newest_version}}</b></p>
|
|
||||||
<!-- <p>如发现新版本更新,可从以下Github仓库下载最新版本使用/If a new version is found, you can download the latest version from the following Github repository:</p>-->
|
|
||||||
<!-- <p></p>-->
|
|
||||||
<div class="img-container">
|
|
||||||
<!-- <h5>出品方/Producer</h5>-->
|
|
||||||
<a href="https://www.zju.edu.cn" alt="浙江大学 Zhejiang University" target="_blank"><img src="img/zju.png"></a>
|
|
||||||
<a href="https://www.nus.edu.sg" alt="新加坡国立大学 National University of Singpaore" target="_blank"><img src="img/nuslogo.png"></a>
|
|
||||||
<a href="https://www.xidian.edu.cn" alt="西安电子科技大学 Xidian University" target="_blank"><img src="img/xidian.png"></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="padding: 10px; text-align: center;vertical-align: middle;" v-else>
|
|
||||||
<div v-if="lang=='en'">
|
|
||||||
<div v-if="step == 0">
|
|
||||||
<p style="margin-top: 20px">Hint: Click Button below to start.</p>
|
|
||||||
|
|
||||||
<p><a @click="step = 1"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Design/Modify Task</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><a @click="startInvoke('en')"
|
|
||||||
@click class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">View/Manage/Invoke
|
|
||||||
Tasks</a></p>
|
|
||||||
<p>
|
|
||||||
<a href="https://www.easyspider.cn/index_english.html" target="_blank" style="text-align: center; font-size: 18px">Browse official website to watch tutorials</a>
|
|
||||||
</p>
|
|
||||||
<div class="img-container">
|
|
||||||
<!-- <h5>Producer</h5>-->
|
|
||||||
<a href="https://www.zju.edu.cn" alt="Zhejiang University" target="_blank"><img src="img/zju.png"></a>
|
|
||||||
<a href="https://www.nus.edu.sg" alt="National University of Singapore" target="_blank"><img src="img/nuslogo.png"></a>
|
|
||||||
<a href="https://www.xidian.edu.cn" alt="Xidian University" target="_blank"><img src="img/xidian.png"></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="step == 1">
|
|
||||||
<h4 style="margin-top: 20px">Please select design mode</h4>
|
|
||||||
<p style="margin-top: 20px; text-align: justify; width:310px; margin-left: 18%">
|
|
||||||
Clean Mode: Start with a clean browser with no cookie/user data.</p>
|
|
||||||
<p style="text-align: justify; width:310px; margin-left: 18%">
|
|
||||||
Data Mode: Start with a browser that stores user data such as website login information and cookies.</p>
|
|
||||||
<p><a @click="startDesign('en')"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Start Clean Mode</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><a @click="startDesign('en', false, true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Clean Mode (Mobile)</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><a @click="step = 2" @click
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Start Data Mode</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 302px;height:45px;padding-top:5px">Go to Home Page</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div v-else-if="step == 2">
|
|
||||||
<h4 style="margin-top: 20px">Specify user data folder</h4>
|
|
||||||
<div style="margin: 0 auto; width:90%">
|
|
||||||
<p style="margin-top: 20px; text-align: justify">
|
|
||||||
Please specify the directory of user data below. Once set, the browser will load cookies and other contents such as user login information from this directory. The browser will load data from this directory every time it is designed and executed, as long as the directory remains the same. </p>
|
|
||||||
<p style="text-align: justify">For example, if the <b>./user_data</b> folder is set and you log in at <b>ebay.com</b> during the design process, then the previous login status will still be retained when you specify the <b>./user_data</b> folder again for the next design or task execution when you open <b>ebay.com</b>.</p>
|
|
||||||
<p style="text-align: justify">If there are multiple configurations, different directories can be set for each configuration. Each directory will be treated as a separate configuration set, and if a directory does not exist, it will be created automatically.</p>
|
|
||||||
<p><textarea class="form-control" style="min-height: 50px;"
|
|
||||||
v-model="user_data_folder"></textarea>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p><a @click="startDesign('en', true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Start Design</a></p>
|
|
||||||
<p>
|
|
||||||
<p><a @click="startDesign('en', true, true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">Start Design (Mobile)</a></p>
|
|
||||||
<p>
|
|
||||||
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 302px;height:45px;padding-top:5px">Go to Home Page</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="lang=='zh'">
|
|
||||||
<div v-if="step == 0">
|
|
||||||
<p style="margin-top: 20px">提示:点击下方按钮开始使用。</p>
|
|
||||||
|
|
||||||
<p><a @click="step = 1" class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">设计/修改任务</a></p>
|
|
||||||
|
|
||||||
<p><a @click="startInvoke('zh')"
|
|
||||||
@click class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;color:white">查看/管理/执行任务</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://www.easyspider.cn?lang=zh" target="_blank" style="text-align: center; font-size: 18px">点此访问官网查看文档/视频教程</a>
|
|
||||||
</p>
|
|
||||||
<div class="img-container">
|
|
||||||
<!-- <h5>出品方</h5>-->
|
|
||||||
<a href="https://www.zju.edu.cn" alt="浙江大学" target="_blank"><img src="img/zju.png"></a>
|
|
||||||
<a href="https://www.nus.edu.sg" alt= "新加坡国立大学" target="_blank"><img src="img/nuslogo.png"></a>
|
|
||||||
<a href="https://www.xidian.edu.cn" alt="西安电子科技大学" target="_blank"><img src="img/xidian.png"></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="step == 1">
|
|
||||||
<h4 style="margin-top: 20px">请选择设计模式</h4>
|
|
||||||
<p style="margin-top: 20px; text-align: left; width:320px; margin-left: 18%">
|
|
||||||
纯净版浏览器:无任何用户信息的浏览器。</p>
|
|
||||||
<p style="text-align: left; width:320px; margin-left: 18%">
|
|
||||||
带用户信息的浏览器:保存有用户数据,如网站的登录信息,cookie的浏览器。</p>
|
|
||||||
<p><a @click="startDesign('zh')"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white;">使用纯净版浏览器设计</a>
|
|
||||||
</p>
|
|
||||||
<p><a @click="startDesign('zh', false, true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white;">纯净版浏览器设计(手机模式)</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><a @click="step = 2" class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">使用带用户信息浏览器设计</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">返回首页</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div v-else-if="step == 2">
|
|
||||||
<h4 style="margin-top: 20px">指定用户信息目录</h4>
|
|
||||||
<div style="margin: 0 auto; width:90%">
|
|
||||||
<p style="margin-top: 20px; text-align: left">
|
|
||||||
请在下方指定用户信息目录。设置后,浏览器将加载目录里的cookie,如用户的登录信息等内容,目录不变的情况下,每次设计和执行时浏览器都会加载此目录里的数据。</p>
|
|
||||||
<p style="margin-top: 10px; text-align: left">例如:设置了./user_data文件夹,并在设计过程中登录了知乎网站,则下次再次设计或者执行任务时指定./user_data文件夹,打开知乎网站页面会仍然保留之前的登录状态。</p>
|
|
||||||
<p style="margin-top: 10px; text-align: left">如果有多套配置,可以设置不同的目录,每个目录为一套,如果目录不存在将会被自动创建。</p>
|
|
||||||
<p><textarea class="form-control" style="min-height: 50px;"
|
|
||||||
v-model="user_data_folder"></textarea>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p><a @click="startDesign('zh', true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">开始设计</a></p>
|
|
||||||
<p>
|
|
||||||
<p><a @click="startDesign('zh', true, true)"
|
|
||||||
class="btn btn-primary btn-lg"
|
|
||||||
style="margin-top: 15px; width: 320px;height:60px;padding-top:12px;color:white">开始设计(手机模式)</a></p>
|
|
||||||
<p>
|
|
||||||
<a @click="step = 0" class="btn btn-outline-primary btn-lg"style="margin-top: 10px; width: 322px;height:45px;padding-top:5px">返回首页</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="module" src="index.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<p><a @click="changeLang('en')" class="btn btn-outline-primary btn-lg"
|
<p><a @click="changeLang('en')" class="btn btn-outline-primary btn-lg"
|
||||||
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">English</a></p>
|
style="margin-top: 15px; width: 300px;height:60px;padding-top:12px;">English</a></p>
|
||||||
<p style="font-size: 17px">当前版本/Current Version: <b>v0.3.5</b></p>
|
<p style="font-size: 17px">当前版本/Current Version: <b>v0.3.6</b></p>
|
||||||
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases" target="_blank">Github</a>最新版本/Newest Version:<b>{{newest_version}}</b></p>
|
<p style="font-size: 17px"><a href="https://github.com/NaiboWang/EasySpider/releases" target="_blank">Github</a>最新版本/Newest Version:<b>{{newest_version}}</b></p>
|
||||||
<!-- <p>如发现新版本更新,可从以下Github仓库下载最新版本使用/If a new version is found, you can download the latest version from the following Github repository:</p>-->
|
<!-- <p>如发现新版本更新,可从以下Github仓库下载最新版本使用/If a new version is found, you can download the latest version from the following Github repository:</p>-->
|
||||||
<!-- <p></p>-->
|
<!-- <p></p>-->
|
||||||
|
@ -429,7 +429,7 @@ function saveService(type) {
|
|||||||
"links": links,
|
"links": links,
|
||||||
"create_time": parseInt(serviceId) == -1 ? new Date().toLocaleString() : $("#create_time").val(),
|
"create_time": parseInt(serviceId) == -1 ? new Date().toLocaleString() : $("#create_time").val(),
|
||||||
"update_time": new Date().toLocaleString(),
|
"update_time": new Date().toLocaleString(),
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
"saveThreshold": saveThreshold,
|
"saveThreshold": saveThreshold,
|
||||||
"cloudflare": cloudflare,
|
"cloudflare": cloudflare,
|
||||||
"environment": environment,
|
"environment": environment,
|
||||||
|
File diff suppressed because one or more lines are too long
2
ExecuteStage/.vscode/launch.json
vendored
2
ExecuteStage/.vscode/launch.json
vendored
@ -12,7 +12,7 @@
|
|||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
// "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
|
// "args": ["--id", "[7]", "--read_type", "remote", "--headless", "0"]
|
||||||
// "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
|
// "args": ["--id", "[9]", "--read_type", "remote", "--headless", "0", "--saved_file_name", "YOUTUBE"]
|
||||||
"args": ["--id", "[34]", "--headless", "0", "--user_data", "1"]
|
"args": ["--id", "[42]", "--headless", "0", "--user_data", "1"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -729,7 +729,13 @@ class BrowserThread(Thread):
|
|||||||
if self.BREAK:
|
if self.BREAK:
|
||||||
self.BREAK = False
|
self.BREAK = False
|
||||||
break
|
break
|
||||||
if self.browser.current_window_handle != thisHandle: # 如果执行完一次循环之后标签页的位置发生了变化
|
try:
|
||||||
|
changed_handle = self.browser.current_window_handle != thisHandle
|
||||||
|
except: # 如果网页被意外关闭了的情况下
|
||||||
|
self.browser.switch_to.window(
|
||||||
|
self.browser.window_handles[-1])
|
||||||
|
changed_handle = self.browser.window_handles[-1] != thisHandle
|
||||||
|
if changed_handle: # 如果执行完一次循环之后标签页的位置发生了变化
|
||||||
try:
|
try:
|
||||||
while True: # 一直关闭窗口直到当前标签页
|
while True: # 一直关闭窗口直到当前标签页
|
||||||
self.browser.close() # 关闭使用完的标签页
|
self.browser.close() # 关闭使用完的标签页
|
||||||
@ -783,7 +789,13 @@ class BrowserThread(Thread):
|
|||||||
if self.BREAK:
|
if self.BREAK:
|
||||||
self.BREAK = False
|
self.BREAK = False
|
||||||
break
|
break
|
||||||
if self.browser.current_window_handle != thisHandle: # 如果执行完一次循环之后标签页的位置发生了变化
|
try:
|
||||||
|
changed_handle = self.browser.current_window_handle != thisHandle
|
||||||
|
except: # 如果网页被意外关闭了的情况下
|
||||||
|
self.browser.switch_to.window(
|
||||||
|
self.browser.window_handles[-1])
|
||||||
|
changed_handle = self.browser.window_handles[-1] != thisHandle
|
||||||
|
if changed_handle: # 如果执行完一次循环之后标签页的位置发生了变化
|
||||||
try:
|
try:
|
||||||
while True: # 一直关闭窗口直到当前标签页
|
while True: # 一直关闭窗口直到当前标签页
|
||||||
self.browser.close() # 关闭使用完的标签页
|
self.browser.close() # 关闭使用完的标签页
|
||||||
@ -1479,7 +1491,7 @@ if __name__ == '__main__':
|
|||||||
"read_type": "remote",
|
"read_type": "remote",
|
||||||
"headless": False,
|
"headless": False,
|
||||||
"server_address": "http://localhost:8074",
|
"server_address": "http://localhost:8074",
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
}
|
}
|
||||||
c = Config(config)
|
c = Config(config)
|
||||||
print(c)
|
print(c)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "EasySpider",
|
"name": "EasySpider",
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "EasySpider",
|
"name": "EasySpider",
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
"description": "EasySpider's chrome extension",
|
"description": "EasySpider's chrome extension",
|
||||||
"author": "Naibo Wang",
|
"author": "Naibo Wang",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user