added credits
This commit is contained in:
4
main.py
4
main.py
@@ -66,6 +66,8 @@ PERSISTENT_PROFILE_PATH = os.path.join(APP_PATH, "firefox_profile/")
|
||||
if not os.path.isdir(APP_PATH):
|
||||
os.mkdir(APP_PATH)
|
||||
|
||||
# by artfulrobot on StackOverflow
|
||||
# https://stackoverflow.com/a/16464305/11109181
|
||||
class AnyEc:
|
||||
""" Use with WebDriverWait to combine expected_conditions
|
||||
in an OR.
|
||||
@@ -120,6 +122,8 @@ def startBrowser(headless: bool = True) -> tuple[Firefox, FirefoxProfile]:
|
||||
def closeBrowser(driver: Firefox, distinguishkey: str) -> None:
|
||||
infoLogger.log("Closing browser...")
|
||||
|
||||
# Workaround by sh4dowb on GitHub
|
||||
# https://gist.github.com/sh4dowb/0054e4b25bf81bccca6f9e622c5cb160
|
||||
for pid in psutil.pids():
|
||||
try:
|
||||
cmdline = open("/proc/"+str(pid)+"/cmdline", "r").read()
|
||||
|
||||
Reference in New Issue
Block a user