yandex / YandexDriver

YandexDriver is a WebDriver implementation
Other
66 stars 14 forks source link

тестовый скрипт для Windows не заработал #22

Open IgorLytkin opened 4 months ago

IgorLytkin commented 4 months ago

Предлагаемый тестовый скрипт выдает ошибку Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from selenium import webdriver options = webdriver.ChromeOptions() binary_yandex_driver_file = 'yandexdriver.exe' # path to YandexDriver driver = webdriver.Chrome(binary_yandex_driver_file, options=options) Traceback (most recent call last): File "", line 1, in TypeError: WebDriver.init() got multiple values for argument 'options'

Заменил тестовый скрипт на from selenium import webdriver from selenium.webdriver.chrome.service import Service

service = Service(executable_path=r"c:\yandexdriver\yandexdriver.exe") driver = webdriver.Chrome(service=service) driver.get('https://yandex.ru')