0
我曾尝试使用phantomjs运行硒。但脚本停止运行没有回应。如何使用phantomjs运行硒?如何将phantomjs链接到硒?
我曾尝试使用phantomjs运行硒。但脚本停止运行没有回应。如何使用phantomjs运行硒?如何将phantomjs链接到硒?
司机= webdriver.PhantomJS(executable_path = 'C:\ \ phantomjs.exe的位置\')
这可能帮助:
PhantomJSDriver driver;
WebDriverWait wait;
DesiredCapabilities capabilities;
Test1()
{
//set binary path of phantomJS driver
capabilities = new DesiredCapabilities();
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "drivers/phantomjs.exe");
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_PAGE_SETTINGS_PREFIX,"Y");
//intialize driver and set capabilties
driver = new PhantomJSDriver(capabilities);
//intitlaize webdriverwait class
wait = new WebDriverWait(driver, 30);
}