added credits

This commit is contained in:
2024-03-18 20:42:45 +01:00
parent f5e61409ef
commit 093b386515
2 changed files with 12 additions and 1 deletions

View File

@@ -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()