Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome din't completes the process in windows #1767

Open
RussianPostman opened this issue Feb 26, 2024 · 3 comments
Open

Chrome din't completes the process in windows #1767

RussianPostman opened this issue Feb 26, 2024 · 3 comments

Comments

@RussianPostman
Copy link

image After successful completion of any program using undetected-chromedriver, the Chrome process remains. This process consumes a lot of CPU resources and does not do anything visible. driver.quit() closes the window, but the process remains and continues to consume resources. How do I shut down the program correctly? This problem is only with undetected-chromedriver
@grah48583
Copy link

did you try this?
#1723

on my pc there is GPU. i had the same issue, i was using the code below then when i tried to disable GPU, issue was resolved.
on my server there is no GPU hence this problem is never occurred.

def fml_chrome():
    try:
        # List all running processes
        tasks = subprocess.check_output(['tasklist'], encoding='utf-8')

        # Check and kill Chrome processes if found
        if 'chrome.exe' in tasks:
            subprocess.run(["taskkill", "/F", "/IM", "chrome.exe", "/T"], check=True)
            logging.info("Chrome processes killed.")
        else:
            logging.info("No Chrome processes found.")

        # Check and kill Chromedriver processes if found
        if 'chromedriver.exe' in tasks:
            subprocess.run(["taskkill", "/F", "/IM", "chromedriver.exe", "/T"], check=True)
            logging.info("Chromedriver processes killed.")
        else:
            logging.info("No Chromedriver processes found.")

    except subprocess.CalledProcessError as e:
        logging.error(f"Error checking or killing processes: {e}")

@0x1991
Copy link

0x1991 commented May 4, 2024

The only way I fixed this issue was calling close() before quit() like:

driver.close()
driver.quit()

@kim-chung-man
Copy link

I too am experiencing the same thing.
I tried the above suggestions, but it didn't solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants