本文介绍了Selenium Webdriver + PhantomJS进程无法关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是您可以使用webdriver和phantom完成的最简单的打开和关闭操作: from selenium import webdriver crawler = webdriver.PhantomJS() crawler.set_window_size(1024,768) crawler.get('https://www.google.com/') crawler.quit()

Here's just about the simplest open and close you can do with webdriver and phantom: from selenium import webdriver crawler = webdriver.PhantomJS() crawler.set_window_size(1024,768) crawler.get('https://www.google.com/') crawler.quit()

在Windows(7)上,每次我运行代码进行测试时,conhost.exe和phantomjs.exe进程的新实例都会启动,并且永远不会退出.我在这里做蠢事吗?我认为crawler.quit()确实会退出该过程.

On windows (7), every time I run my code to test something out, new instances of the conhost.exe and phantomjs.exe processes begin and never quit. Am I doing something stupid here? I figured the processes would quit when the crawler.quit() did...

推荐答案

图.重新启动后问题得以解决.

Go figure. Problem resolved with a reboot.

这篇关于Selenium Webdriver + PhantomJS进程无法关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 01:59