Merge pull request #57 from d0ngw/master

Fix chrome driver can't quit
pull/254/merge
Yihua Huang 11 years ago
commit 19843c063b

@ -1,5 +1,6 @@
package us.codecraft.webmagic.downloader.selenium;
import org.apache.log4j.Logger;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
@ -16,6 +17,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* Time: 1:41 <br>
*/
class WebDriverPool {
private Logger logger = Logger.getLogger(getClass());
private final static int DEFAULT_CAPACITY = 5;
@ -81,8 +83,8 @@ class WebDriverPool {
throw new IllegalStateException("Already closed!");
}
for (WebDriver webDriver : webDriverList) {
webDriver.close();
logger.info("Quit webDriver" + webDriver);
webDriver.quit();
}
}
}

Loading…
Cancel
Save