0

I have a bat file that used to execute powershell scripts and using the EXIT it would at the end close the cmd window. Since i switched the powershells with python-selenium scripts it completely ignores all the EXITs and stays open forever. Any ideas to close the window?

in the BAT:

C:\Users\...\python.exe C:\Users\...\seleniumskript.py
EXIT

The EXIT does not execute...

The python script:

from selenium.webdriver import Edge
driver = Edge()
...doing stuff
driver.close()
quit()
2
  • Did you try removing the "quit()" statement from python module? Commented Oct 14, 2021 at 11:59
  • tried it just now. does not change anything
    – phoinix
    Commented Oct 14, 2021 at 12:03

1 Answer 1

1

Your chromedriver.exe is still running in background. You should try a replacement:

type browser.quit() instead of browser.close().

This will let the chromedriver.exe to close correctly.

4
  • oh yeah that did the trick. Thnx very much
    – phoinix
    Commented Oct 14, 2021 at 15:12
  • For next readers, can you mark my answer as accepted ?
    – BlackMath
    Commented Oct 14, 2021 at 15:19
  • Sorry i cannot upvote yet though... not enough reputation.
    – phoinix
    Commented Oct 14, 2021 at 15:25
  • +10 for you! See ya
    – BlackMath
    Commented Oct 14, 2021 at 15:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.