我在一个django项目中使用selenium。我在views.py中使用它,在我的应用程序中,我通过url链接它。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
def allyears(br):
global browser
path = os.environ['PATH']
browser = webdriver.Chrome(executable_path="/"+path+"/chromedriver)
browser.get('https://www.address.com/recipes/))
我正在尝试安装
Webdriver Chrome
在一个
Django
项目。我链接到路径环境,但不工作。无论如何,当我将其更新到服务器时,我无法链接到物理路由。
那么,如何导入
webdriver.Chrome
或
webdriver.Firefox
在Django?