я пытаюсь открыть браузер, используя селен python
это код
from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
import time
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
#path to TOR binary
binary = FirefoxBinary(r'C:\Users\OKILAN\Desktop\Tor
Browser\Browser\firefox.exe')
#path to TOR profile
profile = FirefoxProfile(r'C:\Users\OKILAN\Desktop\Tor
Browser\Browser\TorBrowser\Data\Browser\profile.default')
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
driver =webdriver.Firefox(capabilities=cap,firefox_binary=binary,executable_path=r'C:\Users\OKILAN\Desktop\geckodriver.exe')
driver.get("http://stackoverflow.com")
time.sleep(5)
driver.quit ()
Когда я запускаю код он показывает, что не удалось запустить, и я получил следующую ошибку
Traceback (most recent call last):
File "C:\Users\OKILAN\Desktop\test1.py", line 13, in <module>
driver = webdriver.Firefox(capabilities=cap,firefox_binary=binary,executable_path=r'C:\Users\OKILAN\Desktop\geckodriver.exe')
File "C:\Users\OKILAN\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 191, in __init__
self.binary, timeout)
File "C:\Users\OKILAN\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "C:\Users\OKILAN\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 73, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "C:\Users\OKILAN\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 104, in _wait_until_connectable
"The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
, помогите мне решить эту ошибку: - (