From 4232cb1e349cf99a9da38a80ebdea01130d8f37e Mon Sep 17 00:00:00 2001 From: carelesssava Date: Thu, 5 Dec 2024 14:25:32 +0300 Subject: [PATCH] Update example desktop usage according to the Selenium updates --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cfeb10c..c79d03c 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,15 @@ Binaries are available under [the releases tab](https://github.com/yandex/Yandex 2. Example code for python on Windows ```python from selenium import webdriver -options = webdriver.ChromeOptions() +from selenium.webdriver.chrome.service import Service -binary_yandex_driver_file = 'yandexdriver.exe' # path to YandexDriver +service = Service(executable_path=r"/path/to/yandexdriver.exe") # Path to the Yandex Driver -driver = webdriver.Chrome(binary_yandex_driver_file, options=options) -driver.get('https://yandex.ru') +options = webdriver.ChromeOptions() + +driver = webdriver.Chrome(service=service, options=options) +driver.get("https://yandex.ru") driver.quit() - ``` @@ -41,6 +42,5 @@ options.add_experimental_option('androidPackage', yandex_browser_package_name) driver = webdriver.Chrome(binary_yandex_driver_file, options=options) driver.get('https://yandex.ru') driver.quit() - ``` - \ No newline at end of file +