zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    python中的time模块
    CSS 布局
    8 Function类型
    2 node 核心
    1 node 简介
    13 对象
    JS 算法一
    JS 模块化
    1 谈谈section标签
    JS 练习一
  • 原文地址:https://www.cnblogs.com/abeen/p/11072203.html
Copyright © 2011-2022 走看看