undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

Doesn't kill the chrome after each try.

Open RexSalazar77 opened this issue 2 years ago • 1 comments

I have try many things but idk why it doesn't close. maybe I am doing something wrong. image

RexSalazar77 avatar Sep 11 '22 02:09 RexSalazar77

driver.quit() driver.close() I used both but it just doesn't close anything.

RexSalazar77 avatar Sep 11 '22 02:09 RexSalazar77

Hey @RexSalazar77 ,

driver.quit() is the function you should be using to terminate properly.

Here is some more information on this issue: https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/793#issuecomment-1255736732

gigacodr avatar Sep 23 '22 02:09 gigacodr

I have same problem, i always use driver.quit() function, but seems that it's doesn't work. I'm using headless=True, also tested on debian and windows machine, and have the same problem

fakz9-dev avatar Oct 04 '22 21:10 fakz9-dev

try to run it on a daemon thread and exit when finished like this:

finished = False
def main():
    # Your Code here
    finished = True

if __name__ == "__main__":
    import threading
    threading.Thread(target=main, daemon=True).start()
    import time
    while not finished:
         time.sleep(1)

or replace the while not finished line with input("Press Enter to Exit...")

Fakesum avatar Oct 05 '22 10:10 Fakesum