Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

Selenium Webdriver session

Level 1
Selenium Webdriver session


I opened a WebDriver Session using Selenium but when I ran the recipe there was an exception and the recipe failed which means that the code where I quit the session hasn't been executed. Now I have multiple Webdriver sessions open but I don't know how to retrieve them and close them. Is there someone who can help with that?

0 Kudos
1 Reply

Hi @marie790 ,

You should always try and except in your code and close the driver before exiting the code even where there is an exception something like:

    # Do something with the driver here
except Exception as e:
    # Handle the error
    print(f"An error occurred: {e}")
    # Close the driver


TO close existing driver session you need to kill the PIDs from CLI

ps -ef | grep chromedriver
kill the PIDS or you can try  pkill chromedriver


0 Kudos