def driver_homeweb(domain, dv=None, i=0): url = TencentManager.homeweb + domain timeout = TencentManager.timeout wait_time = TencentManager.wait_time if dv is not None: BaseDriver.quit_driver(dv) dv = BaseDriver.init_driver(timeout) try: dv.get(url) time.sleep(wait_time) except Exception: return TencentManager.driver_homeweb(domain, dv=dv, i=i + 1) else: return dv
def driver_homeweb(dv=None, i=0): url = BaiduDefender.homeweb timeout = BaiduDefender.timeout wait_time = BaiduDefender.wait_time if dv is not None: BaseDriver.quit_driver(dv) dv = BaseDriver.init_driver(timeout) #初始化无头浏览器driver try: dv.get(url) time.sleep(wait_time) except Exception: return BaiduDefender.driver_homeweb(dv=dv, i=i + 1) else: return dv
def driver_homeweb(domain, dv=None, i=0): url = Jinshan.homeweb + domain timeout = Jinshan.timeout if dv is not None: BaseDriver.quit_driver(dv) dv = BaseDriver.init_driver(timeout) try: dv.get(url) time.sleep(1) except Exception: return Jinshan.driver_homeweb(domain, dv=dv, i=i + 1) else: wait_time = Jinshan.wait_time time.sleep(wait_time) return dv
def driver_homeweb(domain,dv=None,i=0): url = Sanliuling.homeweb+domain timeout = Sanliuling.timeout wait_time = Sanliuling.wait_time if dv is not None: try: dv.delete_all_cookies() except Exception: pass BaseDriver.quit_driver(dv) dv = BaseDriver.init_driver(timeout) try: dv.get(url) time.sleep(wait_time) except Exception: return Sanliuling.driver_homeweb(domain,dv=dv,i=i+1) else: return dv