selenium firefox 內存 速度優化


selenium firefox 內存 速度優化

2 23         profile = webdriver.FirefoxProfile()                                     
2 24         profile.set_preference("permissions.default.image", 2)                   
2 25         # 禁用瀏覽器緩存                                                         
2 26         profile.set_preference("network.http.use-cache", False)                  
2 27         profile.set_preference("browser.cache.memory.enable", False)             
2 28         profile.set_preference("browser.cache.disk.enable", False)               
2 29         profile.set_preference("browser.sessionhistory.max_total_viewers", 3)    
2 30         profile.set_preference("network.dns.disableIPv6", True)                  
2 31         profile.set_preference("Content.notify.interval", 750000)                
2 32         profile.set_preference("content.notify.backoffcount", 3)                 
2 33                                                                                  
2 34         # 有的網站支持   有的不支持                                              
2 35         profile.set_preference("network.http.pipelining", True)                  
2 36         profile.set_preference("network.http.proxy.pipelining", True)            
2 37         profile.set_preference("network.http.pipelining.maxrequests", 32)  

with Firefox(executable_path=FIREFOX_PATH, timeout=60, firefox_options=self._options, firefox_profile=self._profile) as driver:
    pass


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM