diff --git a/ElectronJS/main.js b/ElectronJS/main.js index 3fcd19d..7c58845 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -11,13 +11,13 @@ if (process.platform === 'win32' || process.platform === 'win64') { chromeBinaryPath = path.join(__dirname, "chrome_win32/chrome.exe"); execute_path = path.join(__dirname, "chrome_win32/execute.bat"); } else if (process.platform === 'darwin') { - driverPath = path.join(__dirname, "chrome_mac/chromedriver"); - chromeBinaryPath = path.join(__dirname, "chrome_mac/Chromium.app/Contents/MacOS/Chromium"); - execute_path = path.join(__dirname, "chrome_mac/execute.sh"); + driverPath = path.join(__dirname, "chromedriver_mac64"); + chromeBinaryPath = path.join(__dirname, "chrome_mac64.app/Contents/MacOS/Google Chrome"); + execute_path = path.join(__dirname, "easyspider_executestage"); } else if (process.platform === 'linux') { - driverPath = path.join(__dirname, "chrome_linux/chromedriver"); - chromeBinaryPath = path.join(__dirname, "chrome_linux/chrome"); - execute_path = path.join(__dirname, "chrome_linux/execute.sh"); + driverPath = path.join(__dirname, "chrome_linux64/chromedriver_linux64"); + chromeBinaryPath = path.join(__dirname, "chrome_linux64/chrome"); + execute_path = path.join(__dirname, "chrome_linux64/easyspider_executestage"); } let server_address = "https://servicewrapper.systems"; @@ -91,7 +91,9 @@ function beginInvoke(msg) { let spawn = require("child_process").spawn; let child_process = spawn(execute_path, parameters); - + child_process.stdout.on('data', function (data) { + console.log(data.toString()); + }); } } diff --git a/ExecuteStage/easyspider_executestage.py b/ExecuteStage/easyspider_executestage.py index fee5da3..4e34b5f 100644 --- a/ExecuteStage/easyspider_executestage.py +++ b/ExecuteStage/easyspider_executestage.py @@ -683,8 +683,10 @@ if __name__ == '__main__': options.binary_location = "EasySpider/resources/app/chrome_linux64/chrome" driver_path = "EasySpider/resources/app/chrome_linux64/chromedriver_linux64" elif sys.platform == "darwin" and platform.architecture()[0] == "64bit": - options.binary_location = "EasySpider/chrome_mac64/chrome" - driver_path = "EasySpider/chrome_mac64/chromedriver_mac64" + options.binary_location = "EasySpider/resources/app/chrome_mac64/chrome" + # MacOS需要用option而不是options! + option.binary_location = "EasySpider/resources/app/chrome_mac64/chrome" + driver_path = "EasySpider/resources/app/chrome_mac64/chromedriver_mac64" else: print("Unsupported platform") sys.exit() @@ -693,12 +695,12 @@ if __name__ == '__main__': elif os.path.exists(os.getcwd()+"/Debug"): print("Finding chromedriver in EasySpider", os.getcwd()+"/Debug") - options.binary_location = "Debug/Chrome/chrome.exe" # 指定chrome位置 + option.binary_location = "Debug/Chrome/chrome.exe" # 指定chrome位置 driver_path = "Debug/Chrome/chromedriver.exe" elif os.getcwd().find("ExecuteStage") >= 0: # 如果直接执行 print("Finding chromedriver in EasySpider", os.getcwd()+"/Debug") - option.binary_location = "./Application/chrome.exe" # 指定chrome位置 + options.binary_location = "./Application/chrome.exe" # 指定chrome位置 # option.binary_location = "C:\\Users\\q9823\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe" driver_path = "./Application/chromedriver.exe" else: