def quit(self):
"""
Overrides the base class method cleaning the timestamped profile.
"""
self.is_running = False
try:
wl_log.info("Quit: Removing profile dir")
shutil.rmtree(self.prof_dir_path)
super(TorBrowserDriver, self).quit()
except CannotSendRequest:
wl_log.error("CannotSendRequest while quitting TorBrowserDriver",
exc_info=False)
# following is copied from webdriver.firefox.webdriver.quit() which
# was interrupted due to an unhandled CannotSendRequest exception.
# kill the browser
self.binary.kill()
# remove the profile folder
try:
shutil.rmtree(self.profile.path)
if self.profile.tempfolder is not None:
shutil.rmtree(self.profile.tempfolder)
except Exception as e:
print(str(e))
except Exception:
wl_log.error("Exception while quitting TorBrowserDriver",
exc_info=True)
评论列表
文章目录