Chomedriver“驱动程序不可执行" [英] Chomedriver "The driver is not executable"
本文介绍了Chomedriver“驱动程序不可执行"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在项目文件夹中有我的chromedriver和chromedriver.exe.我正在使用此代码创建驱动程序实例.
I have my chromedriver and chromedriver.exe right in project folder. I'm creating instance of driver with this code.
ChromeOptions options = new ChromeOptions();
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
LoggingPreferences log_prefs = new LoggingPreferences();
log_prefs.enable(LogType.BROWSER, Level.SEVERE);
capabilities.setCapability(CapabilityType.LOGGING_PREFS, log_prefs);
System.setProperty("webdriver.chrome.driver", "chromedriver");
driver = new ChromeDriver(capabilities);
driver.manage().window().maximize();
并且在本地窗口上也可以(如果我们将"chromedriver"更改为"chromedriver.exe"),但是当我在CentOS上运行它时,出现错误消息:驱动程序不可执行".
And it's ok on local windows (if we change "chromedriver" to "chromedriver.exe") , but when i'm running it on CentOS i got error message: "The driver is not executable".
推荐答案
使其可执行:在CentO中,使用 chmod + x chromedriver
Make it executable:
In CentOs use chmod +x chromedriver
这篇关于Chomedriver“驱动程序不可执行"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文