'Service' object has no attribute 'execute'
Hello. I followed the instructions on here (https://github.com/operasoftware/operachromiumdriver/blob/master/docs/desktop.md) and I get an error with this code:
#Create OperaDriver service:
from selenium.webdriver.chrome import service
webdriver_service = service.Service("OperaDriver/operadriver.exe", 9515)
#Create remote webdriver:
from selenium import webdriver
remote = webdriver.Remote(webdriver_service, {"operaOptions": {"binary": "C:/Users/remis/AppData/Local/Programs/Opera GX/launcher.exe"}})
Here is the error:
Traceback (most recent call last):
File "C:/Users/remis/PycharmProjects/SeleniumTest/SeleniumTest.py", line 7, in <module>
remote = webdriver.Remote(webdriver_service, {"operaOptions": {"binary": "C:/Users/remis/AppData/Local/Programs/Opera GX/launcher.exe"}})
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
response = self.command_executor.execute(driver_command, params)
AttributeError: 'Service' object has no attribute 'execute'
Mabe this is caused by the fact that I am trying to make it work with the latest Opera GX. I think it is a chromium-based browser too, so I thought I might try it. Thanks in advance for your help.
@Vynokris hi! Sorry for bothering you. I saw your issue and now checking if still actual or can be closed.
I have checked and today all works fine with actual examples and actual webdrivers and selenium 3/4.
python 3.7, 3.11
Operawebdriver 110.0.5481.100
OperaBrowser 96
Selenium 4.8.2 and 3.141.0
Hope it helps you.
If problem still reproduces, provide more details about selenium version, webdriver version, opera version, python version.
Best regards, @aleksandr-kotlyar