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

    <legend id='AOf9A'><style id='AOf9A'><dir id='AOf9A'><q id='AOf9A'></q></dir></style></legend>
  • <tfoot id='AOf9A'></tfoot>

  • <small id='AOf9A'></small><noframes id='AOf9A'>

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

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

        如何讓 Selenium 不等到整個頁面加載,它的腳本很

        How to make Selenium not wait till full page load, which has a slow script?(如何讓 Selenium 不等到整個頁面加載,它的腳本很慢?)
        • <legend id='QCQzG'><style id='QCQzG'><dir id='QCQzG'><q id='QCQzG'></q></dir></style></legend>
            <bdo id='QCQzG'></bdo><ul id='QCQzG'></ul>

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

          • <tfoot id='QCQzG'></tfoot>
                <tbody id='QCQzG'></tbody>

                <i id='QCQzG'><tr id='QCQzG'><dt id='QCQzG'><q id='QCQzG'><span id='QCQzG'><b id='QCQzG'><form id='QCQzG'><ins id='QCQzG'></ins><ul id='QCQzG'></ul><sub id='QCQzG'></sub></form><legend id='QCQzG'></legend><bdo id='QCQzG'><pre id='QCQzG'><center id='QCQzG'></center></pre></bdo></b><th id='QCQzG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QCQzG'><tfoot id='QCQzG'></tfoot><dl id='QCQzG'><fieldset id='QCQzG'></fieldset></dl></div>
                • 本文介紹了如何讓 Selenium 不等到整個頁面加載,它的腳本很慢?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  Selenium driver.get (url) 等待整個頁面加載.但是一個抓取頁面會嘗試加載一些死掉的 JS 腳本.所以我的 Python 腳本等待它并且不能工作幾分鐘.這個問題可能出現在網站的每個頁面上.

                  Selenium driver.get (url) wait till full page load. But a scraping page try to load some dead JS script. So my Python script wait for it and doesn't works few minutes. This problem can be on every pages of a site.

                  from selenium import webdriver
                  
                  driver = webdriver.Chrome()
                  driver.get('https://www.cortinadecor.com/productos/17/estores-enrollables-screen/estores-screen-corti-3000')
                  # It try load: https://www.cetelem.es/eCommerceCalculadora/resources/js/eCalculadoraCetelemCombo.js 
                  driver.find_element_by_name('ANCHO').send_keys("100")
                  

                  如何限制等待時間,阻止文件的AJAX加載,或者其他方式?

                  How to limit the time wait, block AJAX load of a file, or is other way?

                  我還在 webdriver.Chrome() 中測試我的腳本,但會使用 PhantomJS(),或者可能是 Firefox().因此,如果某些方法使用了瀏覽器設置的更改,那么它必須是通用的.

                  Also I test my script in webdriver.Chrome(), but will use PhantomJS(), or probably Firefox(). So, if some method uses a change in browser settings, then it must be universal.

                  推薦答案

                  當 Selenium 默認加載頁面/url 時,它遵循默認配置,將 pageLoadStrategy 設置為 normal.為了使 Selenium 不等待整個頁面加載,我們可以配置 pageLoadStrategy.pageLoadStrategy 支持以下 3 種不同的值:

                  When Selenium loads a page/url by default it follows a default configuration with pageLoadStrategy set to normal. To make Selenium not to wait for full page load we can configure the pageLoadStrategy. pageLoadStrategy supports 3 different values as follows:

                  1. 正常(全頁加載)
                  2. 渴望(交互式)

                  這是配置pageLoadStrategy的代碼塊:

                  Here is the code block to configure the pageLoadStrategy :

                  • 火狐:

                  from selenium import webdriver
                  from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
                  
                  caps = DesiredCapabilities().FIREFOX
                  caps["pageLoadStrategy"] = "normal"  #  complete
                  #caps["pageLoadStrategy"] = "eager"  #  interactive
                  #caps["pageLoadStrategy"] = "none"
                  driver = webdriver.Firefox(desired_capabilities=caps, executable_path=r'C:path	ogeckodriver.exe')
                  driver.get("http://google.com")
                  

                • Chrome:

                  from selenium import webdriver
                  from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
                  
                  caps = DesiredCapabilities().CHROME
                  caps["pageLoadStrategy"] = "normal"  #  complete
                  #caps["pageLoadStrategy"] = "eager"  #  interactive
                  #caps["pageLoadStrategy"] = "none"
                  driver = webdriver.Chrome(desired_capabilities=caps, executable_path=r'C:path	ochromedriver.exe')
                  driver.get("http://google.com")
                  

                • 注意 : pageLoadStrategynormal, eagernoneWebDriver W3C Editor's DraftpageLoadStrategy 值作為 eager 仍然是一個WIP(Work InChromeDriver 實施中的進展).您可以在 渴望"頁面加載中找到詳細討論Python 中 Chromedriver Selenium 的策略解決方法

                  Note : pageLoadStrategy values normal, eager and none is a requirement as per WebDriver W3C Editor's Draft but pageLoadStrategy value as eager is still a WIP (Work In Progress) within ChromeDriver implementation. You can find a detailed discussion in "Eager" Page Load Strategy workaround for Chromedriver Selenium in Python

                  這篇關于如何讓 Selenium 不等到整個頁面加載,它的腳本很慢?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)

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

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

                  <tfoot id='c6ViF'></tfoot>
                      1. <legend id='c6ViF'><style id='c6ViF'><dir id='c6ViF'><q id='c6ViF'></q></dir></style></legend>
                          <bdo id='c6ViF'></bdo><ul id='c6ViF'></ul>

                            主站蜘蛛池模板: 黄色成人亚洲 | 在线观看中文字幕 | 国产激情一区二区三区 | 国产男女精品 | 精品国产精品三级精品av网址 | 99久久99| 国产精品美女久久久久久久久久久 | 91精品国产91久久久久久吃药 | 亚洲视屏 | 国产一区二区不卡 | 久久中文视频 | 色综合色综合 | 香蕉久久久 | 中文日本在线 | 欧美日韩综合 | 黄色片av| 欧美久久免费观看 | 日韩三级在线观看 | 亚洲欧美日韩精品久久亚洲区 | 精品亚洲一区二区三区四区五区 | 韩日在线观看视频 | 国产精品久久久亚洲 | 亚洲精品日韩视频 | 中文字幕视频在线看5 | 国产一区不卡 | 国产精品成人一区二区三区夜夜夜 | 99热热精品 | 亚洲iv一区二区三区 | 中文二区 | 国产在线观看一区二区三区 | 久久中文免费视频 | 亚洲国产精品日本 | 精品久久久久久久久久久久 | 国产精品成人国产乱 | 91精品国产综合久久久久 | 亚洲一区在线免费观看 | 亚洲精品免费在线 | 夜夜干夜夜操 | 国产日韩欧美在线观看 | 久久精品色欧美aⅴ一区二区 | 国产在线小视频 |