phantombuster / nickjs

Web scraping library made by the Phantombuster team. Modern, simple & works on all websites. (Deprecated)
https://nickjs.org
ISC License
501 stars 48 forks source link

nick.exit() is killing the whole node.js #26

Closed Benraay closed 6 years ago

Benraay commented 6 years ago

Hi guys,

You made a great tool, but I'm running in an issue.

when I try the sample code in node.js when the code is reaching nick.exit(0); the whole node process is killed I was making some tests with postman and as a result the response from the server is always : "Could not get any response" but in the node logs I have : "server started on: 3000" "Tab 1: Navigation (open): http://:www.google.com" "Process finished with exit code 0" and after the node server is not responding and is killed.

I tried also on a remote server the node server is restarting but every time the process is killed.

For now I found a workaround "tab.close()" but it looks like the chrome is staying there in background and every time a new Nick is created a new chrome is launched.

Can you give me some advice about this or is it a bug ?

paps commented 6 years ago

Hi, it's not a bug but a feature.

You can workaround this in two ways:

I suggest the first solution because it's easier (if you don't mind having Chrome stay open on your server (beware of state/cookies being kept))

Benraay commented 6 years ago

thanks I will continue using open/closing tabs and sometimes kill chrome in order to keep memory usage low I saw this technique in phantomJS driving (maybe there are some memory leaks in it)