Skip to content

Commit

Permalink
Linux64
Browse files Browse the repository at this point in the history
  • Loading branch information
NaiboWang committed Mar 23, 2023
1 parent 663b6a0 commit 4e87c08
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ old_code/
*.ini
*.7z
*.mp4

*.tar.xz
25 changes: 25 additions & 0 deletions ElectronJS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

Remember to update EasySpider.crx everytime the extension updates.

## Prerequisite

Download a chrome from the Internet: https://www.google.com/chrome/, and then put them into this folder, with name format of the following:

```
chrome_win32/ # for windows x86
chrome_win64/ # for windows x64
chrome_linux64/ # for linux x64
chrome_mac64/ # for mac x64
```

Then, download the corresponding chromedriver from the Internet on this page: https://chromedriver.chromium.org/downloads, note the **chromedriver version must match your chrome version**!!! And put them into corresponding chrome folder, with name format of the following:

```
chromedriver_win32.exe # for windows x86
chromedriver_win64.exe # for windows x64
chromedriver_linux64 # for linux x64
chromedriver_mac64 # for mac x64
```

For example, if you want to build this software on Windows x64 platform, then you should first download a chrome for windows x64, then copy the whole `chrome` folder to this `ElectronJS` folder and rename the folder to `chrome_win64`, assume the chrome version you downloaded is 110; then, download a `chromedriver.exe` with version 110 for windows x64, and put it into the `chrome_win64` folder, then rename it to `chromedriver_win64.exe`.


Finally, copy the `stealth.min.js` file in this folder to all of these `chrome` folders.

## Run Instruction

On Windows, you need to install `VS Build Tools 2017` (double click the vs_BuildTools.exe in this folder, then select and install the `Visual Studio Build Tools 2017` component) first for node-gyp to install `node-windows-manager`.
Expand Down
19 changes: 11 additions & 8 deletions ElectronJS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (process.platform === 'win32' && process.arch === 'ia32') {
} else if (process.platform === 'linux') {
driverPath = path.join(__dirname, "chrome_linux64/chromedriver_linux64");
chromeBinaryPath = path.join(__dirname, "chrome_linux64/chrome");
execute_path = path.join(__dirname, "chrome_linux64/easyspider_executestage");
execute_path = path.join(__dirname, "chrome_linux64/execute.sh");
}
console.log(driverPath, chromeBinaryPath, execute_path);
let language = "en";
Expand Down Expand Up @@ -100,15 +100,18 @@ function beginInvoke(msg) {
mainWindow.hide();
const window = windowManager.getActiveWindow();
// Prints the currently focused window bounds.
console.log(window.getBounds());
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.
windowManager.requestAccessibility();
// Sets the active window's bounds.
let size = screen.getPrimaryDisplay().workAreaSize
let width = parseInt(size.width)
let height = parseInt(size.height * 0.6)
window.setBounds({ x: 0, y: size.height * 0.4, height:height, width:width });
if(window != undefined){
windowManager.requestAccessibility();
// Sets the active window's bounds.
let size = screen.getPrimaryDisplay().workAreaSize
let width = parseInt(size.width)
let height = parseInt(size.height * 0.6)
window.setBounds({ x: 0, y: size.height * 0.4, height:height, width:width });
}

flowchart_window.show();
} else if (msg.type == 2) {
//keyboard
Expand Down
15 changes: 15 additions & 0 deletions ElectronJS/package_linux64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# This script is used to build the package for Linux 64-bit.
rm -r out
npm run package
mv out/EasySpider-linux-x64 out/EasySpider
rm -r out/EasySpider/resources/app/chrome_win64
rm -r out/EasySpider/resources/app/Data
rm -r out/EasySpider/resources/app/.idea
rm -r out/EasySpider/resources/app/tasks
rm -r out/EasySpider/resources/app/execution_instances
rm -r out/EasySpider/resources/app/user_data
rm -r ../Releases/EasySpider_linux_amd64_Ubuntu/EasySpider
rm out/EasySpider/resources/app/vs_BuildTools.exe
mv out/EasySpider ../Releases/EasySpider_linux_amd64_Ubuntu/EasySpider
5 changes: 5 additions & 0 deletions ExecuteStage/generateExecutable_Linux64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rm -r build
rm -r dist
pyinstaller -F --icon=favicon.ico easyspider_executestage.py
rm ../ElectronJS/chrome_linux64/easyspider_executestage
mv dist/easyspider_executestage ../ElectronJS/chrome_linux64/easyspider_executestage
1 change: 1 addition & 0 deletions Releases/EasySpider_linux_amd64_Ubuntu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EasySpider/
1 change: 1 addition & 0 deletions Releases/EasySpider_linux_amd64_Ubuntu/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"webserver_address":"http:https://localhost","webserver_port":8074,"user_data_folder":"./user_data"}
1 change: 1 addition & 0 deletions Releases/EasySpider_linux_amd64_Ubuntu/easy-spider.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./EasySpider/EasySpider

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":1,"name":"eBay Titles - Simple Demo","url":"https://www.ebay.com","links":"https://www.ebay.com","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"},{"id":1,"name":"inputText_1","nodeName":"Input Text","nodeId":2,"desc":"The text to be entered, such as 'computer' at eBay search box","type":"string","exampleValue":"iPhone","value":"iPhone"},{"id":2,"name":"loopTimes_Loop Click Next Page_2","nodeId":5,"nodeName":"Loop Click Next Page","desc":"Number of loop executions, 0 means unlimited loops (until element not found)","type":"int","exampleValue":10,"value":10}],"outputParameters":[{"id":0,"name":"Title","desc":"","type":"string","exampleValue":"Apple iPhone 11 - 64GB - Black - Carrier Unlocked - NO FACE ID"}],"graph":[{"index":0,"id":0,"parentId":0,"type":-1,"option":0,"title":"root","sequence":[1,2,3,5],"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,"url":"https://www.ebay.com","links":"https://www.ebay.com","scrollType":0,"scrollCount":0}},{"id":2,"index":2,"parentId":0,"type":0,"option":4,"title":"Input Text","sequence":[],"isInLoop":false,"position":1,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"gh-ac\"]","wait":0,"value":"iPhone"}},{"id":3,"index":3,"parentId":0,"type":0,"option":2,"title":"Click Search","sequence":[],"isInLoop":false,"position":2,"parameters":{"history":4,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"gh-btn\"]","wait":0,"scrollType":0,"scrollCount":0,"paras":[]}},{"id":-1,"index":4,"parentId":0,"type":0,"option":2,"title":"Click Element","sequence":[],"isInLoop":false,"position":3,"parameters":{"history":5,"tabIndex":-1,"useLoop":false,"xpath":"//*[@id=\"s0-52-12-5-4[0]-42\"]/form[1]/fieldset[1]/input[1]","wait":0,"scrollType":0,"scrollCount":0,"paras":[]}},{"id":4,"index":5,"parentId":0,"type":1,"option":8,"title":"Loop Click Next Page","sequence":[7,6],"isInLoop":false,"position":3,"parameters":{"history":6,"tabIndex":-1,"useLoop":false,"xpath":"//a[contains(@class,'pagination__next')] ","wait":0,"scrollType":0,"scrollCount":0,"loopType":0,"pathList":"","textList":"","exitCount":10,"historyWait":2}},{"id":6,"index":6,"parentId":4,"type":0,"option":2,"title":"Click Next","sequence":[],"isInLoop":true,"position":1,"parameters":{"history":6,"tabIndex":-1,"useLoop":true,"xpath":"//*[@id=\"srp-river-results\"]/ul[1]/li[61]/div[2]/span[1]/span[1]/nav[1]/a[1]","wait":1,"scrollType":0,"scrollCount":0,"paras":[],"loopType":0}},{"id":5,"index":7,"parentId":4,"type":1,"option":8,"title":"Loop Collection","sequence":[8],"isInLoop":true,"position":0,"parameters":{"history":7,"tabIndex":-1,"useLoop":false,"xpath":"/html/body/div[8]/div[4]/div[2]/div[1]/div[2]/ul[1]/li/div[1]/div[2]","wait":0,"scrollType":0,"scrollCount":0,"loopType":1,"pathList":"","textList":"","exitCount":0,"historyWait":2}},{"id":7,"index":8,"parentId":5,"type":0,"option":3,"title":"Extract Data","sequence":[],"isInLoop":true,"position":0,"parameters":{"history":7,"tabIndex":-1,"useLoop":false,"xpath":"","wait":0,"paras":[{"nodeType":0,"contentType":0,"relative":true,"name":"Title","desc":"","relativeXpath":"//div[contains(@class,'s-item__title')] ","exampleValues":[{"num":0,"value":"Apple iPhone 11 - 64GB - Black - Carrier Unlocked - NO FACE ID"},{"num":1,"value":"Apple iPhone 12 Pro Max - Factory Unlocked - 128GB - Very Good"},{"num":2,"value":"Apple iPhone SE 2nd Gen 64GB Unlocked AT&T T-Mobile Verizon Good Condition"},{"num":3,"value":"Apple iPhone 6 16GB 64GB 128GB Factory Unlocked SmartPhone AT&T T-mobile Verizon"},{"num":4,"value":"Apple iPhone 12 A2172 64/128/256GB AT&T T-Mobile Verizon Unlocked GREAT"},{"num":5,"value":"Apple iPhone 11 - 64GB - All Colors - Fully Unlocked (CDMA+GSM) - Good Condition"},{"num":6,"value":"Apple iPhone 13 PRO MAX 128GB 256GB 512GB 1TB (UNLOCKED) ✅APPLE WARNTY⚫🔴🔵✤O/B✤"},{"num":7,"value":"Apple iPhone 12 Pro 128GB 256GB 512GB Unlocked All Colours Good Condition"},{"num":8,"value":"Apple iPhone XR - 64GB - Fully Unlocked (CDMA+GSM) - Good Condition"},{"num":9,"value":"APPLE IPHONE 7 *ALL COLORS* FACTORY UNLOCKED 32GB (VERY GOOD CONDITION)"},{"num":10,"value":"Apple iPhone 11 64GB Unlocked Smartphone - Very Good"},{"num":11,"value":"Apple iPhone XR - 64GB - All Colors - Fully Unlocked (CDMA+GSM) - Good Condition"},{"num":12,"value":"Apple iPhone 12 Mini 64GB Unlocked Smartphone - Very Good"},{"num":13,"value":"Apple iPhone SE 2nd Gen 64|128|256GB 4G LTE 4.7 Verizon Unlocked T-Mobile AT&T"},{"num":14,"value":"Apple iPhone SE 2nd Gen. 2020 64GB Unlocked A2275 GSM + CDMA -BEST BUDGET DEAL-"},{"num":15,"value":"Apple iPhone 7 Plus - 128GB - Factory Unlocked - Very Good Condition "},{"num":16,"value":"Apple iPhone 12 - 64GB - All Colors - Unlocked Smartphone - Good Condition "},{"num":17,"value":"Apple iPhone 13 A2482 128GB Midnight Unlocked Excellent Condition"},{"num":18,"value":"Apple iPhone 11 64GB/128GB/256GB - ALL COLOURS - UNLOCKED - VERY GOOD CONDITION"},{"num":19,"value":"Apple iPhone 12 Pro Max A2342 256GB Unlocked Good Condition"},{"num":20,"value":"Apple iPhone 12 Pro Max 5G 128GB Factory Unlocked CDMA + GSM EXCELLENT"},{"num":21,"value":"Apple iPhone 12 Pro A2341 128GB Unlocked Very Good Condition (Free Shipping)"},{"num":22,"value":"Apple iPhone 11 A2111 64/128/256 - All Colors - (Factory Unlocked) - Excellent -"},{"num":23,"value":"Apple iPhone 11 Pro Max - 256GB - All Colors (Unlocked) - Very Good Condition "},{"num":24,"value":"Apple iPhone 12 Pro Max (A2342) - All Colors - (Unlocked) - 10/10 Open Box -"},{"num":25,"value":"Apple iPhone 11 Pro 64GB 256GB 512GB Unlocked All Colours Good Condition"},{"num":26,"value":"Apple iPhone 13 (Unlocked) Pre-Order-New Open Box, Free Shipping!"},{"num":27,"value":"Apple iPhone 12 - 5G - 128GB Factory Unlocked GSM + CDMA - OPEN BOX"},{"num":28,"value":"Apple iPhone 8 64GB Factory Unlocked Verizon AT&T T-Mobile Sprint Good"},{"num":29,"value":"Apple iPhone 12 (A2172) 64GB Blue Unlocked GSM/CDMA -Fair Condition"},{"num":30,"value":"Apple iPhone 11 64GB/128GB/256GB - ALL COLOURS - UNLOCKED - GOOD CONDITION"},{"num":31,"value":"Apple iPhone X 64GB 256GB 4G LTE 5.8 Verizon Unlocked T-Mobile AT&T Ultra"},{"num":32,"value":"Apple iPhone 11 64GB Factory Unlocked 4G LTE Smartphone - Good"},{"num":33,"value":"Apple iPhone XR 64GB 128GB Fully Unlocked Smartphone A1984 - Good"},{"num":34,"value":"Apple iPhone XR 64GB Factory Unlocked Smartphone - Very Good"},{"num":35,"value":"Apple iPhone 11 - 128GB - All Colors - Fully Unlocked (CDMA+GSM)- Good Condition"},{"num":36,"value":"NEW Apple iPhone 11 A2111 (FACTORY UNLOCKED) - ALL COLORS & CAPACITY"},{"num":37,"value":"Apple iPhone 12 64GB/128GB/256GB - ALL COLOURS - UNLOCKED- VERY GOOD CONDITION"},{"num":38,"value":"Open Box Apple iPhone 8 Plus 64GB Factory Unlocked Verizon T-Mobile- Gray/Silver"},{"num":39,"value":"Apple iPhone 6s 16/32/64 GB - All Colors - Fully Unlocked - Very Good Condition"},{"num":40,"value":"Apple iPhone 8 64GB GSM Factory Unlocked Smartphone- Excellent condition"},{"num":41,"value":"Apple iPhone 8 | 8 Plus 64GB 128GB 256GB GSM Unlocked ATT T-Mobile Metro Cricket"},{"num":42,"value":"Apple iPhone 8 64GB Verizon T-Mobile AT&T Unlocked Smartphone PRISTINE Condition"},{"num":43,"value":"Apple iPhone 12 128GB Unlocked Smartphone - Very Good"},{"num":44,"value":"Apple iPhone 12 Mini 64GB 128GB 256GB Unlocked AT&T T-Mobile Verizon Very Good"},{"num":45,"value":"Apple iPhone 14 Pro Max Unlocked eSim, Pre-Order.. FREE UPGRADE TO 1TB MODEL!"},{"num":46,"value":"Apple iPhone SE 2nd Gen 2020 Fully Unlocked GSM/CDMA 64GB 128GB 256GB"},{"num":47,"value":"Apple iPhone 6 16GB Space Gray A1549 Unlocked GSM 4G LTE New In Box SEALED"},{"num":48,"value":"Apple iPhone 14 128GB ( Unlocked) Excellent"},{"num":49,"value":"Apple iPhone 12 Mini 5.4\" 64GB 128GB Factory Unlocked (Any Carrier) Very Good"},{"num":50,"value":"Apple iPhone 13 Pro 128/256/512GB A2483 Unlocked Open Box"},{"num":51,"value":"Apple iPhone 8 64GB 256GB Unlocked Open Box New Other"},{"num":52,"value":"Apple iPhone 12 mini (5G) Factory Unlocked GSM+CDMA 256GB 128GB |64GB Excellent"},{"num":53,"value":"Apple iPhone 12 64GB 128GB 256GB Unlocked AT&T T-Mobile Verizon Sprint Very Good"},{"num":54,"value":"Apple iPhone XR 64GB Black Unlocked Fair Condition"},{"num":55,"value":"Apple iPhone 11 Pro -64GB-Space Gray Unlocked A2160 CDMA + GSM Smartphone GOOD "},{"num":56,"value":"Apple iPhone 12 Mini (5G) GSM/CDMA Factory Unlocked 256GB |128GB | 64GB"},{"num":57,"value":"Apple iPhone 11 - 64GB 128GB 256GB - All Colors - Excellent Condition"},{"num":58,"value":"Apple iPhone 11 - 64GB / 128GB / 256GB - Factory Unlocked - Smartphone"},{"num":59,"value":"Apple iPhone 6 A1549 32GB Space Gray Unlocked GSM/CDMA Fair "}],"default":""}],"loopType":1}}]}
Loading

0 comments on commit 4e87c08

Please sign in to comment.