久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

      1. 在 python 中隱藏 chromeDriver 控制臺(tái)

        hide chromeDriver console in python(在 python 中隱藏 chromeDriver 控制臺(tái))

          <tbody id='GXCOA'></tbody>
          <bdo id='GXCOA'></bdo><ul id='GXCOA'></ul>

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

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

                  本文介紹了在 python 中隱藏 chromeDriver 控制臺(tái)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問題描述

                  我在 Selenium 中使用 chrome 驅(qū)動(dòng)程序打開 chrome,登錄到路由器,按一些按鈕,上傳配置等.所有代碼都是用 Python 編寫的.

                  I'm using chrome driver in Selenium to open chrome , log into a router, press some buttons ,upload configuration etc. all code is written in Python.

                  這里是獲取驅(qū)動(dòng)的部分代碼:

                  here is the part of the code to obtain the driver:

                  chrome_options = webdriver.ChromeOptions()
                  prefs = {"download.default_directory":  self.user_local}
                  chrome_options.add_experimental_option("prefs", prefs)
                  chrome_options.experimental_options.
                  driver = webdriver.Chrome("chromedriver.exe", chrome_options=chrome_options)
                  driver.set_window_position(0, 0)
                  driver.set_window_size(0, 0)
                  
                  return driver
                  

                  當(dāng)我啟動(dòng)我的應(yīng)用程序時(shí),我得到一個(gè) chromedriver.exe 控制臺(tái)(一個(gè)黑色窗口),然后打開一個(gè) chrome 窗口,我的所有請(qǐng)求都已完成.

                  when i fire up my app, i get a chromedriver.exe console (a black window) followed by a chrome window opened and all my requests are done.

                  我的問題:在 python 中有沒有辦法隱藏控制臺(tái)窗口?

                  My question: is there a way in python to hide the console window ?

                  (如您所見,我也在調(diào)整 chrome 窗口的大小,我的偏好是以用戶不會(huì)注意到屏幕上發(fā)生的任何事情的方式做事)

                  (as you can see i'm also re-sizing the chrome window ,my preference would be doing things in a way the user wont notice anything happening on screen)

                  謝謝西萬(wàn)

                  推薦答案

                  您必須編輯 Selenium 源代碼才能實(shí)現(xiàn)此目的.我也是菜鳥,我不完全理解編輯源代碼的整體后果,但這是我在 Windows 7、Python 2.7 上隱藏 webdriver 控制臺(tái)窗口所做的工作.

                  You will have to edit Selenium Source code to achieve this. I am a noob too, and I dont fully understand the overall consequences of editing source code but here is what I did to achieve hiding the webdriver console window on Windows 7, Python 2.7.

                  找到并編輯此文件,如下所示:位于Libsite-packagesseleniumwebdrivercommonservice.py 在您的 Python 文件夾中.

                  Locate and edit this file as follows: located at Libsite-packagesseleniumwebdrivercommonservice.py in your Python folder.

                  通過以下方式添加創(chuàng)建標(biāo)志來(lái)編輯 Start() 函數(shù):creationflags=CREATE_NO_WINDOW

                  Edit the Start() function by adding the creation flags this way: creationflags=CREATE_NO_WINDOW

                  修改后的方法如下:

                  def start(self):
                      """
                      Starts the Service.
                  
                      :Exceptions:
                       - WebDriverException : Raised either when it can't start the service
                         or when it can't connect to the service
                      """
                      try:
                          cmd = [self.path]
                          cmd.extend(self.command_line_args())
                          self.process = subprocess.Popen(cmd, env=self.env,
                                                          close_fds=platform.system() != 'Windows',
                                                          stdout=self.log_file, stderr=self.log_file, creationflags=CREATE_NO_WINDOW)
                      except TypeError:
                          raise
                  

                  您必須添加相關(guān)的導(dǎo)入:

                  You will have to add the relevant imports:

                  from win32process import CREATE_NO_WINDOW
                  

                  這也適用于 Chrome webdriver,因?yàn)樗鼈儗?dǎo)入相同的文件來(lái)啟動(dòng) webdriver 進(jìn)程.

                  This should also work for Chrome webdriver as they import the same file to start the webdriver process.

                  這篇關(guān)于在 python 中隱藏 chromeDriver 控制臺(tái)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)

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

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

                      • <tfoot id='QJZNE'></tfoot>
                          <tbody id='QJZNE'></tbody>
                          <legend id='QJZNE'><style id='QJZNE'><dir id='QJZNE'><q id='QJZNE'></q></dir></style></legend>
                            <i id='QJZNE'><tr id='QJZNE'><dt id='QJZNE'><q id='QJZNE'><span id='QJZNE'><b id='QJZNE'><form id='QJZNE'><ins id='QJZNE'></ins><ul id='QJZNE'></ul><sub id='QJZNE'></sub></form><legend id='QJZNE'></legend><bdo id='QJZNE'><pre id='QJZNE'><center id='QJZNE'></center></pre></bdo></b><th id='QJZNE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QJZNE'><tfoot id='QJZNE'></tfoot><dl id='QJZNE'><fieldset id='QJZNE'></fieldset></dl></div>
                            主站蜘蛛池模板: 精品国产青草久久久久96 | 搞黄网站在线观看 | 国产视频一视频二 | 91天堂网 | 日韩精品免费在线观看 | 亚洲欧洲日韩 | 91亚洲精品国偷拍自产在线观看 | 国产在线视频三区 | 国产高潮好爽受不了了夜夜做 | 91影院 | av网址在线 | 一区二区三区四区电影视频在线观看 | 中文字幕一区在线观看视频 | 日本一区二区视频 | 久久国| 欧美 日韩 国产 成人 在线 91 | 黄色欧美视频 | 国产精品视频不卡 | 国产一区免费视频 | 一级国产精品一级国产精品片 | 国产精品久久欧美久久一区 | 欧美亚洲国产日韩 | 97影院在线午夜 | 热久久性 | 成人深夜福利在线观看 | 狠狠亚洲 | 精品国产一区二区三区久久久蜜月 | 精品一区二区三区免费毛片 | 成人深夜小视频 | 欧美一级二级三级 | 亚洲字幕在线观看 | av影音| 国产日韩欧美在线观看 | 日韩成人性视频 | 中文字幕二区三区 | 99草免费视频 | 天天操天天射天天 | 日韩视频一级 | 国产精品色哟哟网站 | 欧美一级久久 | 亚洲一区精品视频 |