Stop running scraper inside callback by click

Hi everyone!
I’m trying to build a scraper using Dash framework. User fills in form with some input parameters, clicks “Run” button and scraper starts to run inside the button callback. Is there any way to kill selenium webdriver process or just stop spider by clicking another “Stop” button?

I don’t think this is possible unless you run the scraper in a separate task.