<legend id='kb7T4'><style id='kb7T4'><dir id='kb7T4'><q id='kb7T4'></q></dir></style></legend>
<tfoot id='kb7T4'></tfoot>

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

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

        python selenium:WebDriverException:消息:chrome无法访问

        时间:2023-06-06
          <tbody id='iSgzf'></tbody>

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

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

                  <bdo id='iSgzf'></bdo><ul id='iSgzf'></ul>
                  <i id='iSgzf'><tr id='iSgzf'><dt id='iSgzf'><q id='iSgzf'><span id='iSgzf'><b id='iSgzf'><form id='iSgzf'><ins id='iSgzf'></ins><ul id='iSgzf'></ul><sub id='iSgzf'></sub></form><legend id='iSgzf'></legend><bdo id='iSgzf'><pre id='iSgzf'><center id='iSgzf'></center></pre></bdo></b><th id='iSgzf'></th></span></q></dt></tr></i><div id='iSgzf'><tfoot id='iSgzf'></tfoot><dl id='iSgzf'><fieldset id='iSgzf'></fieldset></dl></div>
                  <tfoot id='iSgzf'></tfoot>
                  本文介绍了python selenium:WebDriverException:消息:chrome无法访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正面临 python selenium 的问题我输入了下面的代码,几分钟前它运行良好,但现在它不能说 chrome 无法访问请帮忙!

                  I am facing the issue with python selenium I entered the code below, it worked well few minutes ago, but now it doesn't work saying chrome not reachable Please help!

                  from selenium import webdriver
                  driver = webdriver.Chrome('/Users/Danny/Downloads/chromedriver_win32/chromedriver')
                  driver.get('https://google.com')
                  

                  结果

                  ---------------------------------------------------------------------------
                  WebDriverException                        Traceback (most recent call last)
                  <ipython-input-36-6bcc3a6d3d05> in <module>()
                  ----> 1 driver.get('https://google.com')
                  
                  ~Anaconda3libsite-packagesseleniumwebdriver
                  emotewebdriver.py in get(self, url)
                      322         Loads a web page in the current browser session.
                      323         """
                  --> 324         self.execute(Command.GET, {'url': url})
                      325 
                      326     @property
                  
                  ~Anaconda3libsite-packagesseleniumwebdriver
                  emotewebdriver.py in execute(self, driver_command, params)
                      310         response = self.command_executor.execute(driver_command, params)
                      311         if response:
                  --> 312             self.error_handler.check_response(response)
                      313             response['value'] = self._unwrap_value(
                      314                 response.get('value', None))
                  
                  ~Anaconda3libsite-packagesseleniumwebdriver
                  emoteerrorhandler.py in check_response(self, response)
                      240                 alert_text = value['alert'].get('text')
                      241             raise exception_class(message, screen, stacktrace, alert_text)
                  --> 242         raise exception_class(message, screen, stacktrace)
                      243 
                      244     def _value_or_default(self, obj, key, default):
                  
                  WebDriverException: Message: chrome not reachable
                    (Session info: chrome=64.0.3282.140)
                    (Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.16299 x86_64)
                  

                  编辑

                  当我尝试这段代码时它确实有效,但我不知道为什么它突然有效有人能解释一下这段代码吗?

                  It does work when I try this code, but I don't know why it suddenly works Can someone explain this code?

                  driver=webdriver.Chrome(executable_path="C:/UsersDannyDownloadschromedriver_win32chromedriver.exe")
                  
                  for i in range(1,10):
                  driver.get('https://google.com')
                  

                  推荐答案

                  您看到的错误提示我们如下:

                  The error you are seeing gives us some hint as follows :

                  WebDriverException                        Traceback (most recent call last)
                  <ipython-input-36-6bcc3a6d3d05> in <module>()
                  ----> 1 driver.get('https://google.com')
                  

                  以下是一些观察和补救措施:

                  Here are some observations and remedies :

                  • 首先,我希望您回顾一下 ChromeDriver 二进制文件的确切绝对路径,我的猜测是:

                  • First of all, I would like you to look back at the exact absolute path of the ChromeDriver binary and my guess is instead of :

                  /Users/Users/Downloads/chromedriver_win32/chromedriver
                  

                  应该是:

                  /Users/Downloads/chromedriver_win32/chromedriver
                  

                • 此外,传递 ChromeDriver 二进制文件位置的更好方法是同时传递参数 executable_path,因此该行将是:

                • Moreover, a better way to pass the location of the ChromeDriver binary would be to pass the argument executable_path along as well, so the line would be :

                  driver = webdriver.Chrome(executable_path=r'/Users/Users/Downloads/chromedriver_win32/chromedriver')
                  

                • 最后,每当您调用 get() 方法打开一个 URL 时,请尝试传递 完全限定域名 (FQDN) 如下:

                • Finally, whenever you invoke get() method to open an URL try to pass the Fully Qualified Domain Name (FQDN) as follows :

                  driver.get('https://www.google.co.in')
                  

                • 这篇关于python selenium:WebDriverException:消息:chrome无法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:RemoteDisconnected("Remote end closed connection withou 下一篇:WebDriverException:消息:未知错误:Chrome 无法启动:通过 VPS 上的 Python 使用 C

                  相关文章

                  1. <legend id='eBIAd'><style id='eBIAd'><dir id='eBIAd'><q id='eBIAd'></q></dir></style></legend>
                      • <bdo id='eBIAd'></bdo><ul id='eBIAd'></ul>

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

                      <tfoot id='eBIAd'></tfoot>

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