Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 有没有办法将selenium与Opera GX浏览器结合使用?_Python 3.x_Selenium_Url - Fatal编程技术网

Python 3.x 有没有办法将selenium与Opera GX浏览器结合使用?

Python 3.x 有没有办法将selenium与Opera GX浏览器结合使用?,python-3.x,selenium,url,Python 3.x,Selenium,Url,我正在尝试在我的Opera GX浏览器上获取当前页面的url,但我找不到是否有办法做到这一点。我认为selenium可能会工作,但当我运行代码时,它会在命令提示符中给出以下信息: [12252:21468:0914/190450.397:ERROR:CONSOLE(0)] "Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.", source: c

我正在尝试在我的Opera GX浏览器上获取当前页面的url,但我找不到是否有办法做到这一点。我认为selenium可能会工作,但当我运行代码时,它会在命令提示符中给出以下信息:

[12252:21468:0914/190450.397:ERROR:CONSOLE(0)] "Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.", source: chrome://startpage/ (0)
python IDE中的输出错误如下:

selenium.common.exceptions.WebDriverException: Message: unknown error: Opera failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from opera location C:/Users/remis/AppData/Local/Programs/Opera GX/launcher.exe is no longer running, so OperaDriver is assuming that Opera has crashed.)
(Driver info: operadriver=84.0.4147.89 (19abfe7bcba9318a0b2a6bc6634a67fc834aa592-refs/branch-heads/4147@{#852}),platform=Windows NT 10.0.18363 x86_64)
这是我的密码:

from selenium import webdriver
from selenium.webdriver.opera.options import Options
import time

options = Options()
options.binary_location = "C:/Users/remis/AppData/Local/Programs/Opera GX/launcher.exe"
driver = webdriver.Opera(executable_path="C:/Users/remis/PycharmProjects/FormationChecker/operadriver_win64/operadriver.exe", options = options)
print(driver.current_url)
time.sleep(1)

我对硒非常陌生,这只是一个非常简单的测试。我希望有人能帮我解决这个问题。

Hey@Vynokris,你找到解决方案了吗?没有,我不抱歉,但似乎opera gx没有得到很多程序员的支持