如何解决您的Firefox个人资料无法加载。它可能缺少或无法访问”在使用硒的同时
我想将硒与geckodriver一起使用。因此,我已经安装了Firefox和Geckodriver。但是,当我只运行一个简单的硒应用程序时,我会得到一个带有错误的对话框。
我的代码:
public static void main(String[] args) throws MalformedURLException {
System.setProperty("webdriver.gecko.driver", "/usr/bin/geckodriver");
WebDriver driver2 = new FirefoxDriver();
driver2.get("https://google.com");
硒日志:
Mozrunner :: Runner Info Running命令:“/usr/bin/firefox“ - marionette” - marionette“” - no-remote“ - profile”“/tmp/tmp/rust_mozprofilebf85lf”
线程“ main” org.openqa.selenium.webdriverexception中的例外: 过程出乎意料地关闭了状态1构建信息:版本: '3.141.5',修订:'D54EBD709A',时间:'2018-11-06T11:42:16'系统 信息:主机:'my-thinkpad',ip:'192.168.100.117',os.name:'linux','linux', os.ark:'amd64',os.version:'5.15.0-33代',java.version: '13 .0.2'驱动程序信息:驱动程序。version:firefoxdriver
但我作为对话框的主要问题:
无法加载您的Firefox配置文件。它可能丢失或 无法访问。
当我刚刚在终端中运行/usr/bin/firefox ...命令而没有配置文件参数。我从几个教程中获得了提示,以删除我的主目录中的.Mozilla目录,但是没有.Mozilla文件夹。我正在使用Kubuntu 22.04。有什么方法可以在没有配置文件参数的情况下启动geckodriver或解决此问题?
I want to use selenium with geckodriver. So I have installed firefox and Geckodriver. But when I just run a simple selenium Application I get a dialoge box with the error.
My Code:
public static void main(String[] args) throws MalformedURLException {
System.setProperty("webdriver.gecko.driver", "/usr/bin/geckodriver");
WebDriver driver2 = new FirefoxDriver();
driver2.get("https://google.com");
Selenium Log:
mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-no-remote" "-profile" "/tmp/rust_mozprofileBF85Lf"
Exception in thread "main" org.openqa.selenium.WebDriverException:
Process unexpectedly closed with status 1 Build info: version:
'3.141.5', revision: 'd54ebd709a', time: '2018-11-06T11:42:16' System
info: host: 'my-thinkpad', ip: '192.168.100.117', os.name: 'Linux',
os.arch: 'amd64', os.version: '5.15.0-33-generic', java.version:
'13.0.2' Driver info: driver.version: FirefoxDriver
But the main Problem I get as dialogbox:
Your Firefox profile cannot be loaded. It may be missing or
inaccessible.
When I just run the /usr/bin/firefox ... command in terminal without the profile parameter it works. I got the tip from several tutorials to delete the .mozilla directory in my home directory, but there is no .mozilla folder. Im using Kubuntu 22.04. Is there any way to start geckodriver without profile parameter or solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
资料可能存储在没有权限的目录中。因此,显然会失败。
解决方案:
导出tmpdir = $ home/downloads/geckodriver
在我的情况下,我的geckodriver in
下载>下载
,所以我将TMPDIR导出到下载
。或尝试以下操作:
只需将geckodriver移动到有权写入
下载
或文档
的任何其他目录中,然后尝试以上解决方案。Probably the profile gets stored in the directory where there is no permission to write. So, it would obviously fail.
Solution:
export TMPDIR=$HOME/Downloads/ geckodriver
In my case, my geckodriver is in
Downloads
so I exported TMPDIR to theDownloads
.Or try this:
Just move the geckodriver to any other directory where there is permission to write like
Downloads
orDocuments
and try the above solution.