Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python selenium.common.exceptions.webdriverexception消息会话未创建异常_Python_Selenium_Selenium Chromedriver - Fatal编程技术网

Python selenium.common.exceptions.webdriverexception消息会话未创建异常

Python selenium.common.exceptions.webdriverexception消息会话未创建异常,python,selenium,selenium-chromedriver,Python,Selenium,Selenium Chromedriver,我使用selenium(3.4.3)和python3.6以及Chrome开发的自动化程序,已经生成了一个二进制可执行程序。它可以在我的电脑上运行,但是如果我把程序放在一个非python环境中,它就不工作了,我会看到错误消息:WebDriver仍在使用我的电脑路径,我想在需要设置WebDriver之前知道可执行程序的包?现在,我使用cx_Freeze-5.0.1,setup.py配置: import sys from cx_Freeze import setup, Executable buil

我使用selenium(3.4.3)和python3.6以及Chrome开发的自动化程序,已经生成了一个二进制可执行程序。它可以在我的电脑上运行,但是如果我把程序放在一个非python环境中,它就不工作了,我会看到错误消息:WebDriver仍在使用我的电脑路径,我想在需要设置WebDriver之前知道可执行程序的包?现在,我使用cx_Freeze-5.0.1,setup.py配置:

import sys
from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}

base = None
if sys.platform == "win32":
    base = "console"

setup(  name = "Cortan",
    version = "1.0",
    description = "my Canto",
    options = {"build_exe": build_exe_options},enter code here
    executables = [Executable("Cortan.py`enter code here`", base = base)])
错误消息文本:

D:\Cortan>Cortan
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cx_Freeze\initscripts\__startup__.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cx_Freeze\initscripts\Console.py 

", line 24, in <module>
  File "Cortan.py 

", line 5, in <module>
  File "Cortan.py 

", line 7, in Work
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\selenium\webdriver\chrome\webdriver.py 

", line 69, in __init__
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\selenium\webdriver\remote\webdriver.py 

", line 98, in __init__
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\selenium\webdriver\remote\webdriver.py 

", line 188, in start_session
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\selenium\webdriver\remote\webdriver.py 

", line 256, in execute
  File "C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\selenium\webdriver\remote\errorhandler.py 

", line 194, in check_response
selenium.common.exceptions.WebDriverException: Message: session not created exce
ption: Chrome version must be >= 58.0.3029.0
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5b
a8),platform=Windows NT 6.1.7601 SP1 x86_64)
D:\Cortan>Cortan
回溯(最近一次呼叫最后一次):
文件“”,第961行,在“查找”和“加载”中
文件“”,第950行,在“查找”和“加载”中解锁
文件“”,第646行,在“加载”中
文件“”,第616行,可向后加载
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\cx\U Freeze\initscripts\\uuuuu startup\uuuuu.py”,第12行,在
文件“”,第961行,在“查找”和“加载”中
文件“”,第950行,在“查找”和“加载”中解锁
文件“”,第646行,在“加载”中
文件“”,第616行,可向后加载
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\cx\U Freeze\initscripts\Console.py
“,第24行,在
文件“Cortan.py”
“,第5行,在
文件“Cortan.py”
“,第7行,正在工作
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\selenium\webdriver\chrome\webdriver.py
“,第69行,在_init中__
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\selenium\webdriver\remote\webdriver.py
“,第98行,在_init中__
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\selenium\webdriver\remote\webdriver.py
“,第188行,在启动会话中”
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\selenium\webdriver\remote\webdriver.py
,第256行,执行
文件“C:\Users\tyb011\AppData\Local\Programs\Python\Python36-32\lib\site packa
ges\selenium\webdriver\remote\errorhandler.py
“,第194行,在check_响应中
selenium.common.exceptions.WebDriverException:消息:未创建会话exce
选项:Chrome版本必须>=58.0.3029.0
(驾驶员信息:chromedriver=2.31.488763(092de99f48a300323ecf8c2a4e2e7cab51de5b
a8),平台=Windows NT 6.1.7601 SP1 x86_64)

请编辑您的问题并将错误消息添加为格式化文本。好的,我已更新。将错误消息中的给定版本与您的Chrome版本进行比较,并在需要时更新Chrome。您的意思是Chrome版本与原因不匹配?但是,错误消息引用了我的电脑。我的意思是错误消息来自另一台电脑,不是我的电脑。但是,我将尝试更新Chrome版本,谢谢您的回答。请编辑您的问题并将错误消息添加为格式化文本。好,我已更新。请将错误消息中的给定版本与您的Chrome版本进行比较,并在需要时更新Chrome。您的意思是Chrome版本与原因不匹配?但是,错误消息引用了我的电脑。我的意思是错误消息来自另一台电脑,不是我的电脑。但是,我会尝试更新Chrome版本,谢谢你的回答。