Answer the question
In order to leave comments, you need to log in
Problem running Opera in selenium webdriver. What is the correct algorithm?
Hello. Please suggest the correct algorithm for launching Opera using Selenium Web Driver.
Linux Mint, Opera 29.
Other browsers managed to be configured and launched ..
When launched through the console in python, it writes an error
WebDriverException: Message: unknown error: cannot find Opera binary
(Driver info: OperaDriver=0.2.0
Path to Opera /usr/bin /opera
I run this code Opera starts but does not work
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Opera(executable_path='/usr/bin/opera')
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome('/usr/bin/operadriver')
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
/usr/bin/python3.4 /home/ng/works/project/dd/test4.py
Traceback (most recent call last):
File "/home/ng/works/project/dd/test4.py", line 4, in <module>
driver = webdriver.Chrome('/usr/bin/operadriver')
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/webdriver.py", line 90, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/webdriver.py", line 177, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Opera binary
(Driver info: OperaDriver=0.2.0 (ba47709ed9e35ce26dbd960fb5d75be104290d96),platform=Linux 3.19.0-32-generic x86_64)
Process finished with exit code 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question