I use selenium in a my django app and I can not setting Chrome browser. the environment is debian and I use Xvfb. This is my code:
import os
from selenium import webdriver
os.environ["DISPLAY"]=":56017"
def start_chrome(url):
chromedriver = "/dir/app/chromedriver" #dir where I have the chromedriver
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome("path/browser/chrome") #path where is chrome.exe
driver.get(url)
driver.quit()
I get: "Message: 'Can not connect to the ChromeDriver'". Where is the error? Thanks for your help
EDIT: I change the code:
def start_chrome(url):
chromedriver = "/dir/app" #dir where I have the chromedriver
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)
driver.get(url)
driver.quit()
I get: Message: 'ChromeDriver executable needs to be available in the path. Please download from http://code.google.com/p/selenium/downloads/list and read up at http://code.google.com/p/selenium/wiki/ChromeDriver'
Can anyone help me? I do not know what to do. thanks