其他分享
首页 > 其他分享> > 第1篇文章 测试一下

第1篇文章 测试一下

作者:互联网

这是我的第一篇文章
主要是感受一下怎么写的问题
先写一段代码

# 1、启动浏览器
def 启动谷歌浏览器():
        # 杀死以前残留的进程
        os.system("taskkill /F /IM  chromedriver.exe /T")  # 杀死以前残留的进程
        # 驱动文件路径
        driver = webdriver.Chrome('chromedriver.exe')
        return driver
def 启动IE浏览器():
    # 杀死以前残留的进程
    os.system("taskkill /F /IM  IEDriverServer.exe /T")  # 杀死以前残留的进程
    # 驱动文件路径
    driverfile_path = r'IEDriverServer.exe'
    # 启动浏览器
    driver = webdriver.Ie(executable_path=driverfile_path)

然后看结果
怎么报错了呢?

等待,就是下面这段错了

    detect_encoding().
    """
    buffer = _builtin_open(filename, 'rb')
    try:
        encoding, lines = detect_encoding(buffer.readline)
        buffer.seek(0)
        text = TextIOWrapper(buffer, encoding, line_buffering=True)
        text.mode = 'r'
        return text
    except:
        buffer.close()
        raise
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1438, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
    stream = tokenize.open(file)  # @UndefinedVariable
  File "C:\ProgramData\Anaconda3\lib\tokenize.py", line 447, in open
    buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'K:/v3.py'

标签:encoding,buffer,一下,py,篇文章,测试,line,pydev,open
来源: https://blog.csdn.net/weixin_46279624/article/details/119815941