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

      1. <small id='I5ia6'></small><noframes id='I5ia6'>

        <tfoot id='I5ia6'></tfoot>

      2. 错误消息:“chromedriver"可执行文件需要是 PA

        时间:2023-10-08

        <tfoot id='2aPIk'></tfoot>

        <small id='2aPIk'></small><noframes id='2aPIk'>

            <bdo id='2aPIk'></bdo><ul id='2aPIk'></ul>
                  <tbody id='2aPIk'></tbody>

                <i id='2aPIk'><tr id='2aPIk'><dt id='2aPIk'><q id='2aPIk'><span id='2aPIk'><b id='2aPIk'><form id='2aPIk'><ins id='2aPIk'></ins><ul id='2aPIk'></ul><sub id='2aPIk'></sub></form><legend id='2aPIk'></legend><bdo id='2aPIk'><pre id='2aPIk'><center id='2aPIk'></center></pre></bdo></b><th id='2aPIk'></th></span></q></dt></tr></i><div id='2aPIk'><tfoot id='2aPIk'></tfoot><dl id='2aPIk'><fieldset id='2aPIk'></fieldset></dl></div>
              • <legend id='2aPIk'><style id='2aPIk'><dir id='2aPIk'><q id='2aPIk'></q></dir></style></legend>
                • 本文介绍了错误消息:“chromedriver"可执行文件需要是 PATH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我刚开始使用 Selenium 并且能够加载 google,但现在当我运行以下代码时会产生错误:

                  I just started on Selenium and was able to load up google but now when I run the following code it produces the error:

                  selenium.common.exceptions.WebDriverException: Message 'chromedriver' executable needs
                  to be PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
                  

                  为什么说C:Users/Colin/Python/chromedriver"不是路径?

                  Why is it saying "C:Users/Colin/Python/chromedriver" is not a path?

                  from selenium import webdriver
                  
                  browser = webdriver.Chrome("C:Users/Colin/Python/chromedriver")
                  browser.get('http://www.google.com')
                  
                  browser.quit()
                  

                  推荐答案

                  使用 Selenium v​​3.xChromeDriverChrome 浏览器您可能需要通过以下任一选项将参数 executable_pathChromeDriver 二进制文件的 绝对路径 一起传递:

                  While working with Selenium v3.x, ChromeDriver and Chrome Browser you may need to pass the argument executable_path along with the absolute path of the ChromeDriver binary through either of the following options:

                  • 双反斜杠,即 (\)
                  • 单反斜杠,即 () 以及原始 (r) 开关.
                  • 二进制扩展名,即(.exe)
                  • Double back slashes i.e. (\)
                  • Single back slash i.e () along with the raw (r) switch.
                  • Binary extension i.e. (.exe)

                  所以你必须换行:

                  browser = webdriver.Chrome("C:Users/Colin/Python/chromedriver")
                  

                  与:

                  browser = webdriver.Chrome(executable_path=r'C:UsersColinPythonchromedriver.exe')
                  

                  这篇关于错误消息:“chromedriver"可执行文件需要是 PATH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:selenium.common.exceptions.WebDriverException:消息:通过 P 下一篇:WebDriverException:消息:服务 chromedriver 意外退出.状态

                  相关文章

                  最新文章

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

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

                    <legend id='WiisT'><style id='WiisT'><dir id='WiisT'><q id='WiisT'></q></dir></style></legend>
                    1. <tfoot id='WiisT'></tfoot>
                        <bdo id='WiisT'></bdo><ul id='WiisT'></ul>