gpt4 book ai didi

Perl Mechanize 遇到错误 : failed connecting to "localhost", 端口 4242 : so what?

转载 作者:行者123 更新时间:2023-12-01 04:50:24 28 4
gpt4 key购买 nike

[首先;我运行 linux opensuse 11.4 ]

我试着在 linux 机器上运行这个小程序。

更新:嗯嗯,我想我在安装MECHA::FireFox 嗯 - 我应该完成 WWW::Mechanize::Firefox::Troubleshooting 中的步骤!但请相信我 - 这很难做到:尤其是“安装”部分似乎特别适用于我这里的情况!

可能会发生一些可怕的事情。我现在该怎么办!!?

#!/usr/bin/perl


use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();

open(INPUT, "urls.txt") or die "Can't open file: $!";

while (<INPUT>) {
chomp;
$mech->get($_);
my $png = $mech->content_as_png();
}
close(INPUT);
exit;

先决条件:

我有一组 ursl - 存储在 urls.txt 中我已经安装了 mechanize 和 WWW::Mechanize::Firefox

如果我运行脚本,我会遇到 fatal error -

linux-vi17:/home/martin/bin # perl get_shots.pl连接失败,连接到“本地主机”,端口 4242 时出现问题:连接到/usr/lib/perl5/site_perl/5.12.3/MozRepl/Client.pm 第 144 行被拒绝

但是等等 - 我还安装了 mozlRepl ....

K
Running make test
/usr/bin/perl "-Iinc" Makefile.PL --config= --installdeps=Class::Accessor::Fast,0,Module::Pluggable::Fast,0,Template,0,Template::Provider::FromDATA,0,UNIVERSAL::require,0
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-load.t t/10-plugin-repl-enter.t t/11-plugin-repl-search.t t/12-plugin-repl-inspect.t t/13-plugin-repl-load.t t/14-plugin-repl-rename.t t/15-plugin-repl-print.t t/16-plugin-repl-home.t t/17-plugin-repl-back.t t/18-plugin-repl-util-help_url_for.t t/19-plugin-repl-util-doc_for.t t/20-plugin-json.t t/pod-coverage.t t/pod.t
t/00-load.t ........................... 1/3 # Testing MozRepl 0.06
t/00-load.t ........................... ok
t/10-plugin-repl-enter.t .............. [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/10-plugin-repl-enter.t .............. ok
t/11-plugin-repl-search.t ............. [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/11-plugin-repl-search.t ............. ok
t/12-plugin-repl-inspect.t ............ [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/12-plugin-repl-inspect.t ............ ok
t/13-plugin-repl-load.t ............... [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/13-plugin-repl-load.t ............... ok
t/14-plugin-repl-rename.t ............. [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/14-plugin-repl-rename.t ............. ok
t/15-plugin-repl-print.t .............. [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/15-plugin-repl-print.t .............. ok
t/16-plugin-repl-home.t ............... [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/16-plugin-repl-home.t ............... ok
t/17-plugin-repl-back.t ............... [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/17-plugin-repl-back.t ............... ok
t/18-plugin-repl-util-help_url_for.t .. [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/18-plugin-repl-util-help_url_for.t .. ok
t/19-plugin-repl-util-doc_for.t ....... [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/19-plugin-repl-util-doc_for.t ....... ok
t/20-plugin-json.t .................... [DEBUG] MozRepl logging enabled
[DEBUG]
---- Client arguments ----
.----------------------+------------------------------------------.
| client_arg_name | client_arg_value |
+----------------------+------------------------------------------+
| host | localhost |
| port | 4242 |
| timeout | 10 |
| extra_client_args | {} |
'----------------------+------------------------------------------'
t/20-plugin-json.t .................... ok
t/pod-coverage.t ...................... skipped: Test::Pod::Coverage 1.04 required for testing POD coverage
t/pod.t ............................... skipped: Test::Pod 1.14 required for testing POD
All tests successful.
Files=14, Tests=42, 7 wallclock secs ( 0.14 usr 0.08 sys + 2.98 cusr 0.36 csys = 3.56 CPU)
Result: PASS
ZIGOROU/MozRepl-0.06.tar.gz
make test -- OK
Running make install
/usr/bin/perl "-Iinc" Makefile.PL --config= --installdeps=Class::Accessor::Fast,0,Module::Pluggable::Fast,0,Template,0,Template::Provider::FromDATA,0,UNIVERSAL::require,0
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Log.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Client.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Util.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Base.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/JSON.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Search.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Load.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Rename.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Inspect.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Home.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Enter.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Print.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Back.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Util/DocFor.pm
Installing /usr/lib/perl5/site_perl/5.12.3/MozRepl/Plugin/Repl/Util/HelpUrlFor.pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Util::DocFor.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Print.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Inspect.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Back.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Rename.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Util::HelpUrlFor.3pm
Installing /usr/share/man/man3/MozRepl::Client.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::JSON.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Base.3pm
Installing /usr/share/man/man3/MozRepl::Log.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Load.3pm
Installing /usr/share/man/man3/MozRepl::Util.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Home.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Search.3pm
Installing /usr/share/man/man3/MozRepl::Plugin::Repl::Enter.3pm
Installing /usr/share/man/man3/MozRepl.3pm
Appending installation info to /usr/lib/perl5/5.12.3/i586-linux-thread-multi/perllocal.pod
ZIGOROU/MozRepl-0.06.tar.gz
make install -- OK

更新: 嗯嗯,我想我在安装时遇到了该死的严重问题MECHA::FireFox 嗯 - 我应该完成 WWW::Mechanize::Firefox::Troubleshooting 中的步骤!但请相信我 - 这很难做到:尤其是“安装”部分似乎特别适用于我这里的情况!

请告诉我这里出了什么问题...!?不要让我在黑暗中出去

最佳答案

大概你还没有打开 mozlRepl。它不会一直听。

关于Perl Mechanize 遇到错误 : failed connecting to "localhost", 端口 4242 : so what?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8455681/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com