1. <i id='Kg1du'><tr id='Kg1du'><dt id='Kg1du'><q id='Kg1du'><span id='Kg1du'><b id='Kg1du'><form id='Kg1du'><ins id='Kg1du'></ins><ul id='Kg1du'></ul><sub id='Kg1du'></sub></form><legend id='Kg1du'></legend><bdo id='Kg1du'><pre id='Kg1du'><center id='Kg1du'></center></pre></bdo></b><th id='Kg1du'></th></span></q></dt></tr></i><div id='Kg1du'><tfoot id='Kg1du'></tfoot><dl id='Kg1du'><fieldset id='Kg1du'></fieldset></dl></div>
    1. <small id='Kg1du'></small><noframes id='Kg1du'>

    2. <tfoot id='Kg1du'></tfoot><legend id='Kg1du'><style id='Kg1du'><dir id='Kg1du'><q id='Kg1du'></q></dir></style></legend>
        <bdo id='Kg1du'></bdo><ul id='Kg1du'></ul>

      弃用警告:在 Windows 上使用带有 Python Selenium 和 Chromedriver 的 Brave

      DeprecationWarning: use options instead of chrome_options error using Brave Browser With Python Selenium and Chromedriver on Windows(弃用警告:在 Windows 上使用带有 Python Selenium 和 Chromedriver 的 Brave 浏览器使用选项而不是 chrome_options
      <tfoot id='nFIQ4'></tfoot>
          <tbody id='nFIQ4'></tbody>

        <small id='nFIQ4'></small><noframes id='nFIQ4'>

        1. <i id='nFIQ4'><tr id='nFIQ4'><dt id='nFIQ4'><q id='nFIQ4'><span id='nFIQ4'><b id='nFIQ4'><form id='nFIQ4'><ins id='nFIQ4'></ins><ul id='nFIQ4'></ul><sub id='nFIQ4'></sub></form><legend id='nFIQ4'></legend><bdo id='nFIQ4'><pre id='nFIQ4'><center id='nFIQ4'></center></pre></bdo></b><th id='nFIQ4'></th></span></q></dt></tr></i><div id='nFIQ4'><tfoot id='nFIQ4'></tfoot><dl id='nFIQ4'><fieldset id='nFIQ4'></fieldset></dl></div>
            <legend id='nFIQ4'><style id='nFIQ4'><dir id='nFIQ4'><q id='nFIQ4'></q></dir></style></legend>
              <bdo id='nFIQ4'></bdo><ul id='nFIQ4'></ul>

                本文介绍了弃用警告:在 Windows 上使用带有 Python Selenium 和 Chromedriver 的 Brave 浏览器使用选项而不是 chrome_options 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想在我的 Windows 7 64 上安装的 Python (3.8) 上使用 Selenium(安装:ver 3.141.0.dist-info),我使用 Brave 浏览器版本 1.17.73 Chromium: 87.0.4280.67 (Official Build) (64-bit)和

                I want to use Selenium (installed: ver 3.141.0.dist-info) on Python (3.8) which is installed on my Windows 7 64, I Use Brave Browser Version 1.17.73 Chromium: 87.0.4280.67 (Official Build) (64-bit) and

                Chromedriver (chromedriver_win32-87.0.4280.20) 为它,运行以下 Py 文件时,我从 here 获得了代码,新的 Brave 浏览器打开,但出现错误.

                Chromedriver (chromedriver_win32-87.0.4280.20) for it, when running the following Py file which I got the code from here, new Brave browser opens up, but I get errors.

                有什么解决方案可以让它工作吗?感谢您的帮助.

                Any solution to make this works? Appreciate your help.

                运行此文件时:

                from selenium import webdriver
                driver_path = 'C:/python/Python38/chromedriver.exe'
                brave_path = 'C:/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
                option = webdriver.ChromeOptions()
                option.binary_location = brave_path
                browser = webdriver.Chrome(executable_path=driver_path, chrome_options=option)
                
                browser.get("https://www.google.es")
                

                得到这些错误:

                c:/Users/mycomp/Desktop/Python/test/getwebdriver.py:12: DeprecationWarning: use options instead of 
                chrome_options
                browser = webdriver.Chrome(executable_path=driver_path, chrome_options=option)
                [7132:3952:1127/003249.595:ERROR:os_crypt_win.cc(93)] Failed to decrypt: The parameter is incorrect. 
                (0x57)
                [7132:3952:1127/003249.596:ERROR:brave_sync_prefs.cc(114)] Decrypt sync seed failure
                
                DevTools listening on ws://127.0.0.1:51576/devtools/browser/a048c130-e608-4ec6-a388-ad67fc32d97a
                [1127/003250.360:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.452:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.455:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.457:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.458:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.711:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003250.821:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003252.062:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                [1127/003254.498:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglQueryDeviceAttribEXT: 
                Bad attribute.
                
                C:UsersmycompDesktopPython	est>[1127/003304.647:ERROR:gl_surface_egl.cc(773)] EGL Driver message 
                (Error) eglQueryDeviceAttribEXT: Bad attribute.
                

                我从另一个地方找到了解决方案,将以下内容添加到代码中,但我仍然收到错误,错误更少

                I found a solution to this from another place, to add the following to the code, but I still get errors, fewer errors

                option.add_argument('--disable-gpu')
                

                我运行它并得到这个错误:

                I run it and got this error:

                c:/Users/mycomp/Desktop/Python/test/getwebdriver.py:12: DeprecationWarning: 
                use options instead of chrome_options
                browser = webdriver.Chrome(executable_path=driver_path, 
                chrome_options=option)
                [6208:8532:1127/021046.062:ERROR:os_crypt_win.cc(93)] Failed to decrypt: The 
                parameter is incorrect. (0x57)
                [6208:8532:1127/021046.063:ERROR:brave_sync_prefs.cc(114)] Decrypt sync seed 
                failure
                
                DevTools listening on ws://127.0.0.1:53262/devtools/browser/adb0a87d-298a- 
                4b9c-ad00-132a607cb9bd
                

                %20%20browser-with-python-selenium-and-chromedriver

                %20%20browser-with-python-selenium-and-chromedriver

                推荐答案

                chrome_options 曾经弃用.相反,您必须使用 options 并且您的有效代码块将是:

                The key chrome_options was deprecated sometime back. Instead you have to use options and your effective code block will be:

                from selenium import webdriver
                
                driver_path = 'C:/python/Python38/chromedriver.exe'
                brave_path = 'C:/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
                option = webdriver.ChromeOptions()
                option.binary_location = brave_path
                browser = webdriver.Chrome(executable_path=driver_path, options=option)
                
                browser.get("https://www.google.es")
                


                参考文献

                您可以在以下位置找到一些相关的详细讨论:


                References

                You can find a couple of relevant detailed discussion in:

                • DeprecationWarning:改用选项在 Windows 10 系统上通过 Selenium 使用 ChromeDriver 和 Chrome 时出现 chrome_options 错误
                • 如何启动在 Windows 上使用 Selenium 和 Python 的勇敢浏览器

                这篇关于弃用警告:在 Windows 上使用带有 Python Selenium 和 Chromedriver 的 Brave 浏览器使用选项而不是 chrome_options 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                env: python: No such file or directory(env: python: 没有这样的文件或目录)
                How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)
                <tfoot id='dQSU3'></tfoot>

                <i id='dQSU3'><tr id='dQSU3'><dt id='dQSU3'><q id='dQSU3'><span id='dQSU3'><b id='dQSU3'><form id='dQSU3'><ins id='dQSU3'></ins><ul id='dQSU3'></ul><sub id='dQSU3'></sub></form><legend id='dQSU3'></legend><bdo id='dQSU3'><pre id='dQSU3'><center id='dQSU3'></center></pre></bdo></b><th id='dQSU3'></th></span></q></dt></tr></i><div id='dQSU3'><tfoot id='dQSU3'></tfoot><dl id='dQSU3'><fieldset id='dQSU3'></fieldset></dl></div>
                  <tbody id='dQSU3'></tbody>

                <small id='dQSU3'></small><noframes id='dQSU3'>

                  <bdo id='dQSU3'></bdo><ul id='dQSU3'></ul>

                    <legend id='dQSU3'><style id='dQSU3'><dir id='dQSU3'><q id='dQSU3'></q></dir></style></legend>