NaiboWang / EasySpider

A visual no-code/code-free web crawler/spider易采集:一个可视化浏览器自动化测试/数据采集/爬虫软件,可以无代码图形化的设计和执行爬虫任务。别名:ServiceWrapper面向Web应用的智能化服务封装系统。
https://www.easyspider.net
Other
34.66k stars 4.24k forks source link

Unable to collect data on MacOS Sonora #142

Closed uhlhosting closed 1 year ago

uhlhosting commented 1 year ago

Unable to get it working on MacOS, it seems no matter how the task was build, I made it step by step after the video, and I get this;

~/D/EasySpider_MacOS_all_arch ❯❯❯ cd /Users/cosmic/Downloads/EasySpider_MacOS_all_arch
./easyspider_executestage --id '[4]' --user_data 0 --server_address http://localhost:8074 --config_folder "/Users/cosmic/Library/Application Support/EasySpider/" --headless 0 --read_type remote --config_file_name config.json --saved_file_name

Configurations:
+------------------+------+-------------------------------------------------------+
|       Key        | Type | Value                                                 |
+------------------+------+-------------------------------------------------------+
|        id        | list | [4]                                                   |
| saved_file_name  | str  |                                                       |
|    user_data     | bool | False                                                 |
|  config_folder   | str  | /Users/cosmic/Library/Application Support/EasySpider/ |
| config_file_name | str  | config.json                                           |
|    read_type     | str  | remote                                                |
|     headless     | bool | False                                                 |
|  server_address  | str  | http://localhost:8074                                 |
|     version      | str  | 0.3.5                                                 |
+------------------+------+-------------------------------------------------------+

darwin ('64bit', '')
EasySpider.app/Contents/Resources/app/chromedriver_mac64
Config file path: /Users/cosmic/Library/Application Support/EasySpider/config.json

Absolute_user_data_folder: /Users/cosmic/Library/Application Support/EasySpider/user_data 

id:  4
remote
Task Name: eBay product information task
任务名称: eBay product information task

Cannot automatically check new version, please use the following command to check whether a new version avaliable and upgrade by pip: 
pip index versions commandline_config
pip install commandline --upgrade
Save Name for task ID 4 is: 2023_07_27_16_23_53
任务ID 4 的保存文件名为: 2023_07_27_16_23_53
Loading stealth.min.js
新建模式
New Mode
Thread with task id:  4  is created
正在执行第 1 /  1 个链接
Executing link 1 /  1

----------------------------------
正在运行任务,长按键盘p键可暂停任务的执行以便手工操作浏览器如输入验证码;如果想恢复任务的执行,请再次长按p键。
Running task, long press 'p' to pause the task for manual operation of the browser such as entering the verification code; If you want to resume the execution of the task, please long press 'p' again.
----------------------------------

No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
Cannot find input box element://*[@id="gh-ac"], please try to set the wait time before executing this operation
找不到输入框元素://*[@id="gh-ac"],请尝试在执行此操作前设置等待时间
Cannot find element://*[@id="gh-btn"], please try to set the wait time before executing this operation
找不到要点击的元素://*[@id="gh-btn"],请尝试在执行此操作前设置等待时间
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
No such element found in the iframe
Single loop element not found:  //*[contains(@class, "pagination__next")]
找不到要循环的单个元素:  //*[contains(@class, "pagination__next")]
Loop element not found:  /html/body/div[5]/div[4]/div[2]/div[1]/div[2]/ul[1]/li/div[1]/div[2]/a[1]
找不到循环元素:  /html/body/div[5]/div[4]/div[2]/div[1]/div[2]/ul[1]/li/div[1]/div[2]/a[1]
Cannot find element://*[contains(@class, "pagination__next")], please try to set the wait time before executing this operation
找不到要点击的元素://*[contains(@class, "pagination__next")],请尝试在执行此操作前设置等待时间
Done!
执行完成!
程序已运行完成,请手动关闭此窗口。
The program has finished running, please manually close this window.
~/D/EasySpider_MacOS_all_arch ❯❯❯ 
uhlhosting commented 1 year ago

I see the issue might be here;

image

But I am not sure why is saved like Text and not String, since I did same like you showed in video.

NaiboWang commented 1 year ago

It seems that you clicked the Element is inside iframe when designing the task, which should not be selected if your web page is not inside an iframe tag:

Screenshot 2023-07-27 at 10 44 22 PM

Please unselect this and try again, remember to get a new execution id after you modified the task.

uhlhosting commented 1 year ago

@NaiboWang let me check that, I was following your video, you had them in iframe marked I think the video with eBay.

NaiboWang commented 1 year ago

Which video were you watching? I don't think I have any video regarding the iframe. Are you watching from YouTube? Please check again.

uhlhosting commented 1 year ago

You do not mention the iframe, yet I seen it was marked, wait il share printscreen.

So meanwhile I have tried your suggestions, edited the task, removed the =inside framework checkmark and saved it, yet the values are still shown as text.

uhlhosting commented 1 year ago

I have recreated and not marked iframe in any, same results:

image

all values are as Text, if you are interested in debugging this on my side, I can provide Zoom, jitsi meeting or teamviewer, so you can see the steps I did and the results I got.

NaiboWang commented 1 year ago

It's very late in Beijing time and I am on bed now. Maybe you can send the task file to my email address: naibowang@foxmail.com

I will check it tomorrow.

Also, please show me the link of the video, I will watch it to verify it is my video and all steps are correct. And I have tried the eBay task on my Mac, it works fine, so if your task still cannot work, you can also give me an email address and I will send the sample task to you.

uhlhosting commented 1 year ago

send it please to kosmos@highacid.com , I will reply back with my settings. Tell me where they are stored also by default in mac.

NaiboWang commented 1 year ago

Already sent, copy it to /Users/your user name/Library/Application Support/EasySpider/tasks.

uhlhosting commented 1 year ago

Hi,

So I managed to add the file in the tasks folder, yet it seems is not recognized by the program. It still shows only my tasks in the GUI.

NaiboWang commented 1 year ago

Hi,

If you copied the file correctly, the file should be recognized by the program, because I have tried and successfully recognized it, if not, please ensure the folder is correct, it's in /Users/yourUserName/Library/Application Support/EasySpider/tasks.

Or you can create a new task to see if there is a new JSON file in the folder, if not, you put it in the wrong folder; if yes, you can replace your new task file by the file I sent to you.

uhlhosting commented 1 year ago

Hi,

here the path is correct:

image

And i also tried renaming the file to follow the current order. Removing or addding new via program works, by copy / paste not really.

This is really weird, because no matter what changes I do inside EasySpider, no changed happend in that folder you mentioned.

NaiboWang commented 1 year ago

I suggest you remove the whole EasySpider folder and redownload, reopen, and recreated a new task with EasySpider, then see if the folder is recreated again. And When you create a new task, see if there is a new JSON file in the EasySpider/tasks folder.

This is weird to me too, if you can create a new task and successfully saved and reload it, which means it is absolutely stored in your local storage.

uhlhosting commented 1 year ago

I did so, and the results is the same, with your file loaded I get:

image

still text instead of string.

NaiboWang commented 1 year ago

This is my file...You have successfully loaded it. You can try to run it to see if the input box will be automatically entered "iphone" and the search button will be clicked, it should work now.

If you cannot get data, modify the task flow, change the xpath of the loop from /html/body/div[5]/div[4]/div[2]/div[1]/div[2]/ul[1]/li/div[1] to /html/body/div[5]/div/div[2]/div[1]/div[2]/ul[1]/li/div[1], then rerun, it should work then.

I changed the parameter type from string to text at the newer version, if you just wonder why it's not string, this is the answer.

And can you give me the link of my video? Is it from Youtube?

uhlhosting commented 1 year ago

Ok seems regardless if is Text / String, the one you sent me seems to do the work. And it collects the data.