<tfoot id='4l8tI'></tfoot>

        <small id='4l8tI'></small><noframes id='4l8tI'>

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

        如何通过 Selenium 和 Python 以无头模式启动 Chrome

        时间:2023-10-08

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

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

          • <bdo id='fc62j'></bdo><ul id='fc62j'></ul>
            <legend id='fc62j'><style id='fc62j'><dir id='fc62j'><q id='fc62j'></q></dir></style></legend>
              <tbody id='fc62j'></tbody>

                • <tfoot id='fc62j'></tfoot>

                  本文介绍了如何通过 Selenium 和 Python 以无头模式启动 Chrome Canary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  从 selenium 导入 webdriver选项 = webdriver.ChromeOptions()options.binary_location = 'C:UsersmpmccurdyDesktopGoogle Chrome Canary.lnk'options.add_argument('headless')options.add_argument('窗口大小=1200x600')驱动程序 = webdriver.Chrome(chrome_options=options)driver.get("https://www.python.org")

                  解决方案

                  如果你使用 Chrome Canary 作为基础

                  您还可以按照文档 Chrome 二进制位置-a-Chrome-executable-in-a-non-standard-location" rel="nofollow noreferrer">在非标准位置使用 Chrome 可执行文件,如下:

                  从 selenium 导入 webdriver选项 = webdriver.ChromeOptions()options.binary_location = r'C:Program Files (x86)GoogleChromeApplicationchrome.exe'options.add_argument('--headless')options.add_argument('窗口大小=1200x600')driver = webdriver.Chrome(executable_path=r'C:path	ochromedriver.exe', chrome_options=options)driver.get("https://www.python.org")

                  from selenium import webdriver
                  
                  options = webdriver.ChromeOptions()
                  options.binary_location = 'C:UsersmpmccurdyDesktopGoogle Chrome Canary.lnk'
                  options.add_argument('headless')
                  options.add_argument('window-size=1200x600')
                  driver = webdriver.Chrome(chrome_options=options)
                  driver.get("https://www.python.org")
                  

                  解决方案

                  If you are using Chrome Canary as a basic Requirement the server still expects you to have Chrome installed in the default location as per the underlying OS architecture as follows:

                  You can also override the default Chrome Binary Location following the documentation Using a Chrome executable in a non-standard location as follows:

                  from selenium import webdriver
                  
                  options = webdriver.ChromeOptions()
                  options.binary_location = r'C:Program Files (x86)GoogleChromeApplicationchrome.exe'
                  options.add_argument('--headless')
                  options.add_argument('window-size=1200x600')
                  driver = webdriver.Chrome(executable_path=r'C:path	ochromedriver.exe', chrome_options=options)
                  driver.get("https://www.python.org")
                  

                  这篇关于如何通过 Selenium 和 Python 以无头模式启动 Chrome Canary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:SessionNotCreatedException:消息:无法创建新服务:通过 下一篇:selenium.common.exceptions.TimeoutException 同时通过 expe

                  相关文章

                  最新文章

                • <tfoot id='UqlJd'></tfoot>

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

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

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