[英]How to use selenium with chrome driver on Amazon Linux. error: Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary
I'm trying to use selenium-webdriver on Linux in my Rails project. 我正试图在我的Rails项目中使用Linux上的selenium-webdriver。 It works fine locally on my mac, but it doesn't on remote server, Amazon Linux. 它在我的Mac上本地工作正常,但它不在远程服务器,亚马逊Linux上。
Here is the machine info 这是机器信息
$ uname --all
Linux ip-172-31-21-116 4.4.10-22.54.amzn1.x86_64 #1 SMP Tue May 17 22:45:04 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
And this is the error I've got. 这就是我得到的错误。
Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.22.397932 (282ed7cf89cf0053b6542e0d0f039d4123bbb6ad),platform=Linux 4.4.10-22.54.amzn1.x86_64 x86_64)
I installed the chromedriver and put /usr/local/bin
我安装了chromedriver并放入/usr/local/bin
$ ls -al /usr/local/bin
-rwxrwxrwx 1 root root 5952376 Jun 4 12:54 chromedriver
This is what I installed http://chromedriver.storage.googleapis.com/2.22/chromedriver_linux64.zip 这就是我安装的http://chromedriver.storage.googleapis.com/2.22/chromedriver_linux64.zip
Please help me so that I can use Selenium on my Linux. 请帮助我,以便我可以在我的Linux上使用Selenium。 Thanks 谢谢
I would personally not use Selenium in AWS. 我个人不会在AWS中使用Selenium。 I tried http://phantomjs.org that is a similar concept but without the requirement of a browser Phantom has a Full web stack plus no browser required 我尝试了http://phantomjs.org这是一个类似的概念,但没有浏览器的要求Phantom有一个完整的Web堆栈,不需要浏览器
The only thing is that may take quite a while to compile, but give it a try, and you will have no more headaches with Selenium. 唯一的问题是可能需要很长时间才能编译,但是试一试,你不会再对Selenium产生麻烦了。 I find Selenium good but to test locally, where you can see the browser opening and filling forms. 我发现Selenium很好,但要在本地测试,在那里你可以看到浏览器打开和填写表单。 But on the server I would use something different, that runs silently with minimun requirements and can be run from command-line without a browser. 但是在服务器上我会使用不同的东西,它们以最小的要求静默运行,并且可以在没有浏览器的情况下从命令行运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.