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

        <legend id='b2Xqh'><style id='b2Xqh'><dir id='b2Xqh'><q id='b2Xqh'></q></dir></style></legend>
      1. <i id='b2Xqh'><tr id='b2Xqh'><dt id='b2Xqh'><q id='b2Xqh'><span id='b2Xqh'><b id='b2Xqh'><form id='b2Xqh'><ins id='b2Xqh'></ins><ul id='b2Xqh'></ul><sub id='b2Xqh'></sub></form><legend id='b2Xqh'></legend><bdo id='b2Xqh'><pre id='b2Xqh'><center id='b2Xqh'></center></pre></bdo></b><th id='b2Xqh'></th></span></q></dt></tr></i><div id='b2Xqh'><tfoot id='b2Xqh'></tfoot><dl id='b2Xqh'><fieldset id='b2Xqh'></fieldset></dl></div>
        • <bdo id='b2Xqh'></bdo><ul id='b2Xqh'></ul>
        <tfoot id='b2Xqh'></tfoot>
      2. Python Selenium Chrome 网络驱动程序

        时间:2023-10-08
          <legend id='vxmQx'><style id='vxmQx'><dir id='vxmQx'><q id='vxmQx'></q></dir></style></legend>

            <tfoot id='vxmQx'></tfoot>

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

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

                • 本文介绍了Python Selenium Chrome 网络驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在开始自动化这本无聊的东西,我正在尝试通过 python 打开一个 chrome 网络浏览器.我已经安装了 selenium 和

                  I'm beginning the automate the boring stuff book and I'm trying to open a chrome web browser through python. I have already installed selenium and

                  我已尝试运行此文件:

                  from selenium import webdriver
                  from selenium.webdriver.common.by import By
                  from selenium.webdriver.common.keys import Keys
                  
                  browser = webdriver.Chrome()
                  browser.get('https://automatetheboringstuff.com')
                  

                  但正因为如此,我得到了这个错误:

                  But because of that I get this Error:

                  Traceback (most recent call last):   File "C:Program Files
                     (x86)Python36-32libsite-packagesseleniumwebdrivercommonservice.py",
                   line 74, in start
                       stdout=self.log_file, stderr=self.log_file)   File "C:Program Files (x86)Python36-32libsubprocess.py", line 707, in __init__
                       restore_signals, start_new_session)   File "C:Program Files (x86)Python36-32libsubprocess.py", line 990, in _execute_child
                       startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified
                  

                  在处理上述异常的过程中,又发生了一个异常:

                  During handling of the above exception, another exception occurred:

                  Traceback (most recent call last):   File "C:/Program Files
                  (x86)/Python36-32/test.py", line 5, in <module>
                      browser = webdriver.Chrome()   File "C:Program Files (x86)Python36-32libsite-packagesseleniumwebdriverchromewebdriver.py",
                  line 62, in __init__
                     self.service.start()   File "C:Program Files (x86)Python36-32libsite-packagesseleniumwebdrivercommonservice.py",
                  line 81, in start
                     os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver'
                    executable needs to be in PATH. Please see
                  https://sites.google.com/a/chromium.org/chromedriver/home
                  

                  推荐答案

                  你需要指定你的chromedriver所在的路径.

                  1. 从此处下载所需平台的 chromedriver.

                  将 chromedriver 放在系统路径或代码所在的位置.

                  Place chromedriver on your system path, or where your code is.

                  如果不使用系统路径,请链接您的 chromedriver.exe(对于非 Windows 用户,它只是称为 chromedriver):

                  If not using a system path, link your chromedriver.exe (For non-Windows users, it's just called chromedriver):

                  browser = webdriver.Chrome(executable_path=r"C:path	ochromedriver.exe")
                  

                  (将 executable_path 设置为您的 chromedriver 所在的位置.)

                  (Set executable_path to the location where your chromedriver is located.)

                  如果您已将 chromedriver 放置在系统路径中,则只需执行以下操作即可快捷方式:

                  If you've placed chromedriver on your System Path, you can shortcut by just doing the following:

                  browser = webdriver.Chrome()

                  如果您运行的是基于 Unix 的操作系统,您可能需要在下载后更新 chromedriver 的权限以使其可执行:

                  If you're running on a Unix-based operating system, you may need to update the permissions of chromedriver after downloading it in order to make it executable:

                  chmod +x chromedriver

                  就是这样.如果您仍然遇到问题,可以在其他 StackOverflow 文章中找到更多信息:可以'不要为 Selenium 使用 chrome 驱动程序

                  That's all. If you're still experiencing issues, more info can be found on this other StackOverflow article: Can't use chrome driver for Selenium

                  这篇关于Python Selenium Chrome 网络驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Selenium Python 和 chromedriver 截取整页截图 下一篇:WebDriverException:消息:使用 ChromeDriver 和 Selenium 在

                  相关文章

                  最新文章

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

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

                      • <bdo id='M4gOc'></bdo><ul id='M4gOc'></ul>