-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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.
image
Beta Was this translation helpful? Give feedback.
All reactions
You should always use self.driver.quit()
instead of self.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 into seleniumbase/core/browser_launcher.py
and replace from selenium import webdriver
with from 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 include from seleniumwire import webdriver
in ...
Replies: 1 comment
-
You should always use self.driver.quit()
instead of self.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 into seleniumbase/core/browser_launcher.py
and replace from selenium import webdriver
with from 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 include from seleniumwire import webdriver
in your example and then run the code you had.
Beta Was this translation helpful? Give feedback.