求解 :driver能调起浏览器,但是不能操作浏览器
报错如下:Message: chrome not reachable
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.18363 x86_64)代码如下:
def startBrowser(name):
try:
if name == "sogou":
# 给Chrome一个二进制
options = webdriver.ChromeOptions()# 启动参数
options.binary_location = SogouBrowser_location
chrome_driver_binary = SogouBrowser_path
print("start browser name :sogou")
driver = webdriver.Chrome(executable_path=chrome_driver_binary, options=options)
return driver
else:
print("Not found this browser,You can use 'firefox', 'chrome', 'ie' or 'phantomjs'")
except Exception as msg:
print("启动浏览器出现异常:%s" % str(msg))
@threads(5)
def run_case(name):
driver = startBrowser(name)
driver.get(open_url)
time.sleep(3)
print(driver.title)
driver.quit()
if __name__ == "__main__":
names = ["sogou"]
for i in names:
run_case(i)
看下driver版本是否匹配 没有匹配对应版本 浏览器版本与驱动版本没有对应上吧? 你好,请问这个问题解决了吗,是driver版本与搜狗浏览器的内核版本不一致引起的吗,我也遇见这个问题了,现在想请教下你
页:
[1]