mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-20 04:39:57 +08:00
MACOS
This commit is contained in:
parent
9cd3e2c988
commit
6f9757d4dc
BIN
ElectronJS/.DS_Store
vendored
Normal file
BIN
ElectronJS/.DS_Store
vendored
Normal file
Binary file not shown.
3
ElectronJS/.gitignore
vendored
3
ElectronJS/.gitignore
vendored
@ -3,7 +3,8 @@ out/
|
||||
chrome_win32/
|
||||
chrome_win64/
|
||||
chrome_linux64/
|
||||
chrome_macos/
|
||||
chrome_mac64.app/
|
||||
chromedriver_mac64
|
||||
user-data/
|
||||
user_data/
|
||||
Data/
|
||||
|
@ -1 +1 @@
|
||||
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data"}
|
||||
{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","absolute_user_data_folder":"/Users/naibowang/Documents/EasySpider/ElectronJS/user_data"}
|
BIN
ElectronJS/easyspider_executestage
Executable file
BIN
ElectronJS/easyspider_executestage
Executable file
Binary file not shown.
3
ElectronJS/execute_macos.sh
Executable file
3
ElectronJS/execute_macos.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./easyspider_executestage $1 $2 $3 $4 $5 $6 $7 $8 $9
|
@ -7,7 +7,6 @@ const chrome = require('selenium-webdriver/chrome');
|
||||
const {ServiceBuilder} = require('selenium-webdriver/chrome');
|
||||
const {rootCertificates} = require('tls');
|
||||
const {exit} = require('process');
|
||||
const {windowManager} = require("node-window-manager");
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const {exec} = require('child_process');
|
||||
@ -35,7 +34,7 @@ if (process.platform === 'win32' && process.arch === 'ia32') {
|
||||
} else if (process.platform === 'darwin') {
|
||||
driverPath = path.join(__dirname, "chromedriver_mac64");
|
||||
chromeBinaryPath = path.join(__dirname, "chrome_mac64.app/Contents/MacOS/Google Chrome");
|
||||
execute_path = path.join(__dirname, "easyspider_executestage");
|
||||
execute_path = path.join(__dirname, "execute_macos.sh");
|
||||
} else if (process.platform === 'linux') {
|
||||
driverPath = path.join(__dirname, "chrome_linux64/chromedriver_linux64");
|
||||
chromeBinaryPath = path.join(__dirname, "chrome_linux64/chrome");
|
||||
@ -113,7 +112,8 @@ async function beginInvoke(msg) {
|
||||
console.log(window);
|
||||
// This method has to be called on macOS before changing the window's bounds, otherwise it will throw an error.
|
||||
// It will prompt an accessibility permission request dialog, if needed.
|
||||
if (window != undefined) {
|
||||
if(!process.platform == "linux" && !process.platform == "darwin"){
|
||||
const {windowManager} = require("node-window-manager");
|
||||
windowManager.requestAccessibility();
|
||||
// Sets the active window's bounds.
|
||||
let size = screen.getPrimaryDisplay().workAreaSize
|
||||
@ -333,7 +333,9 @@ function handleOpenBrowser(event, lang = "en", user_data_folder = "") {
|
||||
}
|
||||
// and load the index.html of the app.
|
||||
flowchart_window.loadURL(url);
|
||||
flowchart_window.hide();
|
||||
if(process.platform != "darwin"){
|
||||
flowchart_window.hide();
|
||||
}
|
||||
flowchart_window.on('close', function (event) {
|
||||
mainWindow.show();
|
||||
driver.quit();
|
||||
|
@ -62,7 +62,7 @@
|
||||
"icon": "favicon.ico",
|
||||
"appVersion": "0.1.0",
|
||||
"name": "EasySpider",
|
||||
"executableName":"easy-spider",
|
||||
"executableName": "easy-spider",
|
||||
"appCopyright": "Naibo Wang (naibowang@foxmail.com)",
|
||||
"win32metadata": {
|
||||
"ProductName": "EasySpider",
|
||||
|
1
ElectronJS/tasks/34.json
Normal file
1
ElectronJS/tasks/34.json
Normal file
@ -0,0 +1 @@
|
||||
{"id":34,"name":"新web采adsf","url":"https://www.jd.com","links":"https://www.jd.com","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"},{"id":1,"name":"inputText_1","nodeName":"提取数据","nodeId":2,"desc":"要输入的文本,如京东搜索框输入:电脑","type":"string","exampleValue":"赛跟","value":"赛跟"}],"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":"","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,"url":"https://www.jd.com","links":"https://www.jd.com","scrollType":0,"scrollCount":0}},{"id":2,"index":2,"parentId":0,"type":0,"option":4,"title":"提取数据","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"key\"]","wait":0,"value":"赛跟"}},{"id":3,"index":3,"parentId":0,"type":0,"option":2,"title":"打开网页","sequence":[],"isInLoop":false,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"search-btn\"]/i[1]","wait":0,"scrollType":0,"scrollCount":0,"paras":[]}}]}
|
BIN
ExecuteStage/.DS_Store
vendored
Normal file
BIN
ExecuteStage/.DS_Store
vendored
Normal file
Binary file not shown.
5
ExecuteStage/generateExecutable_Macos.sh
Executable file
5
ExecuteStage/generateExecutable_Macos.sh
Executable file
@ -0,0 +1,5 @@
|
||||
rm -r build
|
||||
rm -r dist
|
||||
pyinstaller -F --icon=favicon.ico easyspider_executestage.py
|
||||
rm ../ElectronJS/chrome_mac64/easyspider_executestage
|
||||
mv dist/easyspider_executestage ../ElectronJS/chrome_linux64/easyspider_executestage
|
Loading…
x
Reference in New Issue
Block a user