Версии:
Когда я пытаюсь:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://seleniumhq.org/')
Я получаю это:
Traceback (most recent call last):
File "C:\Users\Me\Desktop\python\FFtests.py", line 3, in <module>
driver = webdriver.Firefox()
File "C:\Users\Me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in __init__
RemoteWebDriver.__init__(
File "C:\Users\Me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\Me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
Когда я пытаюсь:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
driver = webdriver.Firefox(capabilities = cap)
driver.get('https://seleniumhq.org/')
Я получаю это:
Traceback (most recent call last):
File "C:\Users\me\Desktop\python\FFtests.py", line 6, in <module>
driver = webdriver.Firefox(capabilities = cap)
File "C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 190, in __init__
executor = ExtensionConnection("127.0.0.1", self.profile,
File "C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 73, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 103, in _wait_until_connectable
raise WebDriverException(
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.
IEDriver отлично работает для IE
У меня Windows Visual Studio установлен как https://github.com/mozilla/geckodriver/releases указывает, что я должен.
Что может Я делаю, чтобы эта работа?