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

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

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

      1. 如何在 selenium chromedriver 中使用經過身份驗證的代

        How to use authenticated proxy in selenium chromedriver?(如何在 selenium chromedriver 中使用經過身份驗證的代理?)
            1. <i id='pgLtN'><tr id='pgLtN'><dt id='pgLtN'><q id='pgLtN'><span id='pgLtN'><b id='pgLtN'><form id='pgLtN'><ins id='pgLtN'></ins><ul id='pgLtN'></ul><sub id='pgLtN'></sub></form><legend id='pgLtN'></legend><bdo id='pgLtN'><pre id='pgLtN'><center id='pgLtN'></center></pre></bdo></b><th id='pgLtN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pgLtN'><tfoot id='pgLtN'></tfoot><dl id='pgLtN'><fieldset id='pgLtN'></fieldset></dl></div>

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

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

                  本文介紹了如何在 selenium chromedriver 中使用經過身份驗證的代理?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  搜索了好幾個小時后,我開始認為這是不可能的.

                  After searching for many hours I am starting to think this is impossible.

                  我需要為每次運行使用不同的經過身份驗證的(非公共)代理通過 selenium 運行 Chrome.

                  I need to run Chrome through selenium using different authenticated (not public) proxy's for each run.

                  PROXY_IP = "<some IP address>"
                  UID = "<the user id>"
                  PWD = "<the password">
                  
                  options = webdriver.ChromeOptions()
                  options.add_argument("--proxy-server=%s:%s@%s" % (UID,PWD,PROXY_IP))
                  
                  driver = webdriver.Chrome(executable_path=".\driver\chromedriver.exe",
                                            chrome_options=options)
                  driver.get("<site URL>")
                  

                  Chrome 將啟動并顯示錯誤:

                  Chrome will fire-up and display the error:

                  This webpage is not available
                  ERR_NO_SUPPORTED_PROXIES
                  

                  如果我使用像這樣不需要身份驗證的公共代理...

                  If I use a public proxy requiring no authentication like this...

                  PROXY_IP = "<public proxy IP address>"
                  
                  options = webdriver.ChromeOptions()
                  options.add_argument("--proxy-server=%s" % PROXY_IP)
                  
                  driver = webdriver.Chrome(executable_path=".\driver\chromedriver.exe",
                                            chrome_options=options)
                  driver.get("<site URL>")
                  

                  ...它運行良好并在使用代理時顯示站點.

                  ...it runs just fine and displays the site while using the proxy.

                  我還嘗試了在用戶 ID 前添加 http:// 的變體:

                  I also tried a variant with http:// in front of the user ID:

                  options.add_argument("--proxy-server=http://%s:%s@%s" % (UID,PWD,PROXY_IP))
                  

                  我進行了廣泛的搜索,但沒有找到解決方案,這讓我相信根本不存在.

                  The fact that I have searched far and wide and haven't found a solution leads me to believe none might exist.

                  我確實找到了這個,但我無法理解它:

                  I did find this but I can't make sense out of it:

                  selenium chromedriver 身份驗證代理

                  不確定 browswermob-proxy 是什么或應該做什么或如何在 Python 中實現和測試.除非絕對必要,否則我討厭堆積創可貼解決方案.

                  Not sure what browswermob-proxy is or is supposed to do or how to implement and test in Python. I hate piling up band-aid solutions unless they are absolutely necessary.

                  編輯(21 年 11 月 8 日):

                  EDIT (08NOV21):

                  我已經多年不使用 Selenium 了.正因為如此,我現在缺乏上下文(和時間,對不起)來檢查提供的較新答案并將一個標記為該問題的解決方案.SO 是否有一種機制可以用來有效地將這一職能委托給可能是該領域專業知識的當前從業者?

                  I have been away from using Selenium for many years. Because of this I now lack the context (and time, sorry) to go through the newer answers being provided and mark one as the solution to this problem. Does SO have a mechanism one could use to effectively delegate this function to someone who might be a current practitioner with expertise in this domain?

                  推薦答案

                  要在 python selenium 中使用帶有身份驗證的代理,您可以使用 硒線.

                  To use proxies with auth in python selenium you can use seleniumwire.

                  首先,使用 pip install selenium-wire

                  然后從 seleniumwire 導入 webdriver 而不是 selenium

                  Then import webdriver from seleniumwire instead selenium

                  from seleniumwire import webdriver
                  options = {
                      'proxy': {
                          'http': 'http://username:password@host:port', 
                          'https': 'https://username:password@host:port',
                          'no_proxy': 'localhost,127.0.0.1' # excludes
                      }
                  }
                  browser = webdriver.Chrome(path_to_driver, seleniumwire_options=options)
                  

                  現在您可以像使用 selenium 一樣使用瀏覽器實例:browser.get('https://api.ipify.org') 等等...

                  Now you can use your browser instance exact the same way as selenium: browser.get('https://api.ipify.org') and so on...

                  這篇關于如何在 selenium chromedriver 中使用經過身份驗證的代理?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
                  <tfoot id='vgDqB'></tfoot>

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

                            <tbody id='vgDqB'></tbody>
                        • <legend id='vgDqB'><style id='vgDqB'><dir id='vgDqB'><q id='vgDqB'></q></dir></style></legend>

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

                          • <bdo id='vgDqB'></bdo><ul id='vgDqB'></ul>
                          • 主站蜘蛛池模板: 久久久久国产精品一区二区 | 免费一级做a爰片久久毛片潮喷 | 性天堂网 | 欧美精品福利 | 91超碰在线观看 | 国产91在线播放精品91 | 亚洲国产精品福利 | 欧美一区二区三区在线看 | 我要看黄色录像一级片 | 久热精品视频 | 久久国内 | 国产欧美日韩在线播放 | 成人精品视频99在线观看免费 | av免费在线播放 | 特黄特黄a级毛片免费专区 av网站免费在线观看 | 亚洲精品一区二区三区在线 | 欧美日韩一二三区 | 99小视频| 中文字幕高清一区 | 天天av天天好逼 | 成人欧美一区二区 | 9191av| 国产精品久久免费观看 | 免费能直接在线观看黄的视频 | 成人激情视频网 | 国产成人99久久亚洲综合精品 | 草久久 | 国产高清在线观看 | 国产精品一区在线 | 成人免费网视频 | 精品一区二区av | 毛片a级| 欧美激情国产精品 | 人人澡人人射 | 欧美中文一区 | 免费xxxx大片国产在线 | 国产精品一区二区日韩 | 国产美女福利在线观看 | 一区二区三区四区在线视频 | 欧美亚洲视频 | 日本在线免费看最新的电影 |