public void run() { Article a = null; while (downloads) { if (articleList.size() > 0) { if (driver == null) { // driver = new HtmlUnitDriver(); driver = new ChromeDriver(); } a = null; synchronized (articleList) { if (articleList.size() > 0) { a = articleList.remove(0); } } if (a != null) { textExtraction(a); ArticleHandler ah = ArticleHandler.createInstance(); ah.notifyListeners(ArticleListener.TEXT_EXTRACTED, a); } } } driver.quit(); stopped = true; }
public static void quit() { driver.quit(); }