Py学习  »  Python

Chrome open在用python运行Selenium测试后立即退出

Ryan • 4 年前 • 456 次点击  

Chrome open在用python运行Selenium测试之后立即退出。有什么建议吗?我搜遍了所有地方,但没有任何帮助。

from selenium import webdriver
import os

class AutoAlef():
    def test (self):
        driver_location = 'D:\\chromedriver.exe'
        os.environ["webdriver.chrome.driver"] = driver_location
        driver = webdriver.Chrome(driver_location)
        driver.get("http://www.google.com/")

ChromeTest = AutoAlef()
ChromeTest.test()
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/51974
 
456 次点击