调用PhantomJS异常:Sessions clean-up phase starting NOW

调用PhantomJS异常:Sessions clean-up phase starting NOW

问题:
调用PhantomJS异常:Sessions clean-up phase starting NOW
解决方案:
Java:
DesiredCapabilities dcap = new DesiredCapabilities();
dcap.setCapability("takesScreenshot", false);
Python:
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
dcap = dict(DesiredCapabilities.PHANTOMJS) #设置useragent
dcap["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0) Gecko/20100101 Firefox/25.0") #根据需要设置具体的浏览器信息
dcap["takesScreenshot"] = (False) #TakesScreenshot接口来捕捉网页的截屏
driver = webdriver.PhantomJS(desired_capabilities=dcap)#封装浏览器信息
driver.get("http://fund.eastmoney.com/" + code + ".html")
driver.browser.set_page_load_timeout(180) #设置浏览器超时

原文地址:https://www.cnblogs.com/lizm166/p/13826953.html