您如何授予WWW :: Mechanize :: Firefox启动Firefox的权限? [英] How do you give WWW::Mechanize::Firefox permission to launch Firefox?

查看:154
本文介绍了您如何授予WWW :: Mechanize :: Firefox启动Firefox的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上.我有一个简单的Perl脚本,该脚本使用WWW :: Mechanize :: Firefox提取网页.

I'm on a Mac. I've got a simple Perl script that uses WWW::Mechanize::Firefox to pull up a web page.

当Firefox已经打开并在我的计算机上运行时,该脚本可以完美运行.这是创建对象的行:

The script works perfectly when Firefox is already open and running on my computer. Here's the line the creates the object:

my $mech = WWW::Mechanize::Firefox->new(
  launch => '/Applications/Firefox.app'
);

但是,当Firefox关闭并运行脚本时,出现以下错误:

However, when Firefox is shutdown and I run the script, I get the following error:

exec failed: Permission denied at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 463
 at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 463

我该如何授予perl脚本启动Firefox的权限?

What do I do to give the perl script permission to launch Firefox?

推荐答案

尝试:

my $mech = WWW::Mechanize::Firefox->new(
  launch => '/Applications/Firefox.app/Contents/MacOS/firefox'
);

/Applications/Firefox.app是应用程序包装器,并且是包含组成应用程序的各种文件的目录.应用程序包装器中Contents/MacOS/firefox处的文件是应用程序的主要可执行文件.

/Applications/Firefox.app is the application wrapper and is a directory that contains the various files that make up the application. The file at Contents/MacOS/firefox within the application wrapper is the main executable of the application.

这篇关于您如何授予WWW :: Mechanize :: Firefox启动Firefox的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆