def clear_data(self): '''清除浏览器数据 ''' if hasattr(self._browser, 'clear_data'): try: return self._browser.clear_data() except NotImplementedError: pass logger.warn('[%s] Browser %s not implement clear_data method' % (self.__class__.__name__, self._browser.__class__.__name__))
def close(self): ''' 关闭浏览器,并清理数据 :return: ''' if hasattr(self._browser, 'close'): try: return self._browser.close() except NotImplementedError: pass logger.warn('[%s] Browser %s not implement close method' % (self.__class__.__name__, self._browser.__class__.__name__))