use selenium, multithreading for Java to crawl, and each thread opens a chrome browser;
each thread quit exits;
crawls for a few days and finds a pile of unclosed threads in the background; memory explodes directly
use selenium, multithreading for Java to crawl, and each thread opens a chrome browser;
each thread quit exits;
crawls for a few days and finds a pile of unclosed threads in the background; memory explodes directly
you can send a special identity on the command line when you start chrome, for example, before the threadId, thread exits, use the wmic command to find the process PID, according to the identity and taskkill-f-pid xxx to kill it.
in addition, there is no need to launch a separate browser for each thread, you can use no trace mode
Previous: What do you mean by this.$emit ('input',this.val); in vue?
Next: Nginx outputs incorrect website content when configuring reverse proxy