Update v2.py

This commit is contained in:
Leon 2021-01-17 06:43:03 +01:00 committed by GitHub
parent 4fa212f0c5
commit 645a686cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -190,7 +190,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
capabilities = self.options.to_capabilities()
super().start_session(capabilities, browser_profile)
def get_in(self, url: str, delay=1, factor=0.5):
def get_in(self, url: str, delay=1, factor=1):
"""
:param url: str
:param delay: int
@ -221,13 +221,12 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
is not already reported.
"""
try:
self.close()
threading.Timer(factor or self.factor, self.close).start()
self.get(url)
finally:
pass
time.sleep(delay or self.delay)
self.start_session()
self.close()
# threading.Timer(factor or self.factor, self.close).start()
time.sleep(delay or self.delay)
self.start_session()
def quit(self):
try: