Init driver before start #973
-
Hello! Can I immediately redefine driver before starting? Now I'm stopping the old driver and connecting a new one to it. I want to immediately specify the necessary driver. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should always use |
Beta Was this translation helpful? Give feedback.
You should always use
self.driver.quit()
instead ofself.driver.close()
, because otherwise you might leave open running processes. That being said, running the above code from your example will lose all the SeleniumBase settings that are set when the browser is launched. In your particular case, you may want to fork/clone SeleniumBase and then go intoseleniumbase/core/browser_launcher.py
and replacefrom selenium import webdriver
withfrom seleniumwire import webdriver
so that you can run your specific seleniumwire code. But if you don't care about the SeleniumBase default options, then you can probably do what you're trying to do now if you includefrom seleniumwire import webdriver
in …