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

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

      1. <tfoot id='XcmRL'></tfoot>
      2. <legend id='XcmRL'><style id='XcmRL'><dir id='XcmRL'><q id='XcmRL'></q></dir></style></legend>

        InvalidArgumentException:消息:無效參數:使用 ChromeDri

        InvalidArgumentException: Message: invalid argument: user data directory is already in use error while initiating Chrome with ChromeDriver Selenium(InvalidArgumentException:消息:無效參數:使用 ChromeDriver Selenium 啟動 Chrome 時,用
      3. <i id='h6Cmy'><tr id='h6Cmy'><dt id='h6Cmy'><q id='h6Cmy'><span id='h6Cmy'><b id='h6Cmy'><form id='h6Cmy'><ins id='h6Cmy'></ins><ul id='h6Cmy'></ul><sub id='h6Cmy'></sub></form><legend id='h6Cmy'></legend><bdo id='h6Cmy'><pre id='h6Cmy'><center id='h6Cmy'></center></pre></bdo></b><th id='h6Cmy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='h6Cmy'><tfoot id='h6Cmy'></tfoot><dl id='h6Cmy'><fieldset id='h6Cmy'></fieldset></dl></div>

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

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

            • <tfoot id='h6Cmy'></tfoot>
                <bdo id='h6Cmy'></bdo><ul id='h6Cmy'></ul>

                    <tbody id='h6Cmy'></tbody>
                1. 本文介紹了InvalidArgumentException:消息:無效參數:使用 ChromeDriver Selenium 啟動 Chrome 時,用戶數據目錄已在使用中出錯的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用我的默認用戶使用 selenium python 庫打開一個網頁,腳本使用默認用戶很重要,但如果我的 chrome 瀏覽器已經打開,腳本會崩潰并給我這個錯誤:

                  selenium.common.exceptions.InvalidArgumentException:消息:無效參數:用戶數據目錄已在使用中,請為 --user-data-dir 參數指定唯一值,或者不要使用 --user-數據目錄

                  我已經嘗試了這里給出的所有解決方案:

                  現有 Chrome 瀏覽器會話中的新窗口快照:

                  <小時>

                  結論

                  雖然錯誤仍然被拋出,但新的 Chrome 窗口仍會啟動,但仍與已打開的 Chrome 會話連接,但新窗口無法由 WebDriver 實例.

                  <小時>

                  解決方案

                  你需要注意幾件事:

                  • 如果您使用 默認 Chrome 配置文件在同一臺測試機上訪問其他工作的網頁,則不應設置 user-data-dir 作為用戶數據,因為它仍然被您手動啟動的其他 Chrome 進程鎖定.
                    • 在上述場景中,您需要創建和使用另一個 Chrome 配置文件,您可以在 如何通過 Python 打開 Chrome 配置文件
                  • 如果你在一個獨立的測試系統中執行你的測試,你可以將user-data-dir設置為..User DataDefault 以訪問默認 Chrome 配置文件.
                    • 在上述場景中,您需要創建和使用另一個 Chrome 配置文件,您可以在 如何在 Selenium Webdriver Python 3 中使用 Chrome 配置文件
                  • 但是,根據最佳做法,您必須始終創建一個新的 Chrome 配置文件來執行您的測試,因為 默認 Chrome 配置文件可能包含 擴展程序書簽瀏覽歷史等,可能無法正常加載.
                    • 您可以在 如何通過 Selenium 的 --user-data-dir 參數打開 Chrome 配置文件

                  I am trying to open a web page using the selenium python library with my default user, it is critical that the script uses the default user but if my chrome browser is already open the script crashes and gives me this error:

                  selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
                  

                  I have tried all the solutions given here :

                  Selenium chromedriver won't launch URL if another chrome instance is open

                  Selenium won't open a new URL in a new tab (Python & Chrome)

                  and read that there was a bug in older chromedriver versions but it was fixed in chrome 74 (which im using ) : https://github.com/SeleniumHQ/docker-selenium/issues/741

                  from selenium import webdriver
                  import time
                  from getpass import getuser
                  
                  def run():
                      # Chrome driver path
                      chromedriver = r'C:Usersuser1Downloadschromedriver_win32chromedriver_new.exe'
                  
                      # Get chrome webdriver options and set open the browser as headless
                      chrome_options = webdriver.ChromeOptions()
                      #chrome_options.add_argument("--headless")
                  
                      # Fix for selenium Issue 2907
                      #chrome_options.add_argument('--log-level=3')
                      #chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
                  
                      # Load current user default profile
                      current_user = getuser()
                      chrome_options.add_argument(
                          r"--user-data-dir=C:Users{}AppDataLocalGoogleChromeUser Data".format(current_user))
                  
                      # didable "Chrome is being controled by an automated test software"
                      chrome_options.add_argument('disable-infobars')
                  
                      # get Chrome to stay open
                      chrome_options.add_experimental_option("detach", True)
                  
                      # open browser with options and driver
                      driver = webdriver.Chrome(options=chrome_options, executable_path=chromedriver)
                      driver.get(r'https://www.youtube.com/watch?v=dQw4w9WgXcQ')
                  
                  
                  
                  if __name__ == '__main__':
                      run()
                  

                  if i run it without a chrome browser open its fine if not it crashes

                  解決方案

                  This error message...

                  selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
                  

                  ...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session using the specified user data directory as it was already in use.


                  I was able to reproduce the error in my local windows-10box as follows:

                  • Code Block:

                    from selenium import webdriver
                    import getpass
                    
                    options = webdriver.ChromeOptions() 
                    options.add_argument("start-maximized")
                    options.add_argument(r"--user-data-dir=C:Users{}AppDataLocalGoogleChromeUser Data".format(getpass.getuser()))
                    driver = webdriver.Chrome(options=options, executable_path=r'C:WebDriverschromedriver.exe')
                    driver.get("https://www.google.com/")
                    

                  • Complete relevant traceback:

                    [18516:23156:0204/032227.883:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
                    [18516:23156:0204/032227.898:ERROR:cache_util.cc(141)] Unable to move cache folder C:UsersSoma BhattacharjeeAppDataLocalGoogleChromeUser DataShaderCacheGPUCache to C:UsersSoma BhattacharjeeAppDataLocalGoogleChromeUser DataShaderCacheold_GPUCache_000
                    [18516:23156:0204/032227.898:ERROR:disk_cache.cc(178)] Unable to create cache
                    [18516:23156:0204/032227.898:ERROR:shader_disk_cache.cc(605)] Shader Cache Creation failed: -2
                    Opening in existing browser session.
                    Traceback (most recent call last):
                    .
                    selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
                    


                  Analysis

                  The error stack trace clearly complains of Access is denied as the program was unable to move the cache folder ..ShaderCacheGPUCache to ..ShaderCacheold_GPUCache_000. hence the creation of cache failed and subsequently creation of Shader Cache Creation failed. Though these issues raises the InvalidArgumentException but forcefully able to open a new window within the existing Chrome Browser Session.

                  Snapshot of existing Chrome Browser Session:

                  Snapshot of new window within the existing Chrome Browser Session:


                  Conclusion

                  Though the error is thrown still the new Chrome window gets initiated but remains attached with the already opened Chrome session but the new window can't be controlled by the WebDriver instance.


                  Solution

                  You need to take care of a couple of things:

                  • If you are using the Default Chrome Profile to access webpages for your other work on the same Test Machine, you shouldn't set user-data-dir as the User Data as it remains locked by the other Chrome process you have initiated manually.
                    • In the above scenario you need to create and use another Chrome Profile and you can find a detailed discussion in How to open a Chrome Profile through Python
                  • If you are executing your tests in a isolated test system, you can set user-data-dir as ..User DataDefault to access the Default Chrome Profile.
                    • In the above scenario you need to create and use another Chrome Profile and you can find a detailed discussion in How to use Chrome Profile in Selenium Webdriver Python 3
                  • However as per best practices you must always create a new Chrome Profile to execute your tests as the Default Chrome Profile may contain Extensions, Bookmarks, Browsing History, etc, and may not load properly.
                    • You can find a detailed discussion in How to open a Chrome Profile through --user-data-dir argument of Selenium

                  這篇關于InvalidArgumentException:消息:無效參數:使用 ChromeDriver Selenium 啟動 Chrome 時,用戶數據目錄已在使用中出錯的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  • <i id='efMYm'><tr id='efMYm'><dt id='efMYm'><q id='efMYm'><span id='efMYm'><b id='efMYm'><form id='efMYm'><ins id='efMYm'></ins><ul id='efMYm'></ul><sub id='efMYm'></sub></form><legend id='efMYm'></legend><bdo id='efMYm'><pre id='efMYm'><center id='efMYm'></center></pre></bdo></b><th id='efMYm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='efMYm'><tfoot id='efMYm'></tfoot><dl id='efMYm'><fieldset id='efMYm'></fieldset></dl></div>

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

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

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

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

                            主站蜘蛛池模板: 国内精品久久久久久久 | 成人在线视频网址 | 日韩欧美一级精品久久 | 波多野结衣一二三区 | 人人鲁人人莫人人爱精品 | 免费一区二区三区在线视频 | 成人一区av偷拍 | 亚洲久在线 | 亚洲毛片在线观看 | 一区二区三区影院 | 久久久久国产精品 | 久久青青 | 成人av网站在线观看 | 在线日韩欧美 | 日韩视频在线观看中文字幕 | 国产清纯白嫩初高生在线播放视频 | 久久久人成影片一区二区三区 | 欧美一级淫片免费视频黄 | 在线播放国产一区二区三区 | 亚洲精品日韩在线 | 亚洲国产欧美精品 | 国产欧美日韩在线观看 | 国产精品久久久久婷婷二区次 | 精品av| av男人的天堂av | aⅴ色国产 欧美 | 国产精品一区二区三级 | 色综合视频 | 草久视频| 中文字幕精品一区 | 欧美中文| 超碰97免费在线 | 国产成人一区二区 | 精品免费在线 | 免费网站国产 | 久草视| 色射综合| 亚洲欧美一区二区三区视频 | 视频二区 | 精品无码久久久久国产 | 精品国产欧美 |