- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个 perl 脚本,它使用 WWW::Mechanize 打开到我们的单点登录页面的 SSL 连接,以测试 Nagios 的连接性。昨天,那个脚本停止工作了,我不知道为什么。这是该脚本的调试片段:
main::(./check_profiles.pl:13): $auth_url = "https://account.example.com/SSO/index.html";
main::(./check_profiles.pl:14): $profile_url = "https://example.com/prof";
main::(./check_profiles.pl:16): $user = "nagios\@heyyou.com";
main::(./check_profiles.pl:17): $pass = "testing123";
main::(./check_profiles.pl:18): $expected_string = "Bunnies";
main::(./check_profiles.pl:21): $digest_username = "user";
main::(./check_profiles.pl:22): $digest_password = "pass";
main::(./check_profiles.pl:25): $mech = WWW::Mechanize->new( agent=>"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" );
main::(./check_profiles.pl:28): $mech->credentials("example.com/prof:443","Nokia", $digest_username=>$digest_password);
main::(./check_profiles.pl:31): $mech->add_handler("request_send", sub { shift->dump; return });
main::(./check_profiles.pl:32): $mech->add_handler("response_done", sub { shift->dump; return });
main::(./check_profiles.pl:35): $mech->get( $auth_url );
GET https://account.example.com/SSO/index.html
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
(no content)
500 Can't connect to account.example.com:443 (connect: Network is unreachable)
Content-Type: text/plain
Client-Date: Wed, 15 May 2013 16:16:25 GMT
Client-Warning: Internal response
500 Can't connect to account.example.com:443 (connect: Network is unreachable)\n
Error GETing https://account.example.com/SSO/index.html: Can't connect to account.example.com:443 (connect: Network is unreachable) at ./check_profiles.pl line 35
at /usr/share/perl5/vendor_perl/WWW/Mechanize.pm line 2747
WWW::Mechanize::_die('Error ', 'GET', 'ing ', 'URI::https=SCALAR(0x3291d40)', ': ', 'Can\'t connect to account.example.com:443 (connect: Network is ...') called at /usr/share/perl5/vendor_perl/WWW/Mechanize.pm line 2734
WWW::Mechanize::die('WWW::Mechanize=HASH(0x31ce490)', 'Error ', 'GET', 'ing ', 'URI::https=SCALAR(0x3291d40)', ': ', 'Can\'t connect to account.example.com:443 (connect: Network is ...') called at /usr/share/perl5/vendor_perl/WWW/Mechanize.pm line 2383
WWW::Mechanize::_update_page('WWW::Mechanize=HASH(0x31ce490)', 'HTTP::Request=HASH(0x330f490)', 'HTTP::Response=HASH(0x3489c28)') called at /usr/share/perl5/vendor_perl/WWW/Mechanize.pm line 2213
WWW::Mechanize::request('WWW::Mechanize=HASH(0x31ce490)', 'HTTP::Request=HASH(0x330f490)') called at /usr/share/perl5/LWP/UserAgent.pm line 387
LWP::UserAgent::get('WWW::Mechanize=HASH(0x31ce490)', 'https://account.example.com/SSO/index.html') called at /usr/share/perl5/vendor_perl/WWW/Mechanize.pm line 407
WWW::Mechanize::get('WWW::Mechanize=HASH(0x31ce490)', 'https://account.example.com/SSO/index.html') called at ./check_profiles.pl line 35
如您所见,WWW::Mechanize 认为没有 443 访问 account.example.com,但事实并非如此。如果这是真的,我的整个应用程序都会崩溃,但它运行良好。这是进一步的证明:
> telnet account.example.com 443
Trying 2.2.2.2...
Connected to account.example.com.
Escape character is '^]'.
我不知道为什么会这样。任何人都可以根据调试信息确定问题,或提供任何进一步的帮助吗?谢谢!
最佳答案
WWW::Mechanize 为 1.66-1。
升级到 1.72-1,问题消失了。
关于perl - WWW::Mechanize 突然看不到https网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16576649/
我正在使用 mechanize python 登录网站 combochat2.us用户名 mask3和密码findnext ,但它显示了“没有找到 Mechanize 模块”之类的错误 import
我在我的 rails 应用程序中使用 gem mechanize 来抓取网页数据。 我这样使用它: agent = Mechanize.new document = agent.get("http:/
我正在学习机械。我正在尝试打开一个文本文件,您点击的链接显示 文本 (.prn)我遇到的一个问题是此页面上只有 1 个表单,并且该文件不在表单中。对我来说另一个问题是此页面上有几个文本文件,但它们都具
def return_with_soup(url): #uses mechanize to tell the browser we aren't a bot #and to retri
我正在开发一个项目,使用 python 和 Mechanize 。我有个问题 : Mechanize 返回的页面,有不是的 URLS Mechanize ,如果用户点击它,他们将通过链接 他们自己计算
问题: 解析网站时,有些字符会导致 Mechanize 无法正确解析。 提出的解决方案 解析来自网站的响应以删除这些字符 在 Mechanize 之前尝试解析它。 或者,在 Mechanize 解析网
有一个public class method将字段添加到 Mechanize 表单 我试过了.. #login_form.field.new('auth_login','Login') #login_
我有一些看起来像这样的东西: def self.foo agent = Mechanize.new form = agent.get("link/to/form/url") form.f
我在使用 Mechanize gem 时遇到问题,如何转换 Mechanize::文件 进入 Mechanize::页面 , 这是我的一段代码: **link** = page.link_with(:
我正在尝试抓取一个只能依靠类和元素层次结构来找到正确节点的站点。但是使用 Mechanize::Page#search 返回 Nokogiri::XML::Element,我不能用它来填写和提交表单等
我正在使用 mechanize 来抓取一些网页。 我需要知道什么是 Mechanize 限制? Mechanize 不能做什么? 它可以执行网页中嵌入的javascripts吗? 我可以用它来调用 j
在 WWW::Mechanize 中使用表单方法 my @form = $mech->form_number(1); foreach my $sum_form ( @form ) {
找到以下 HTML 代码: 如何使用 Mechanize 单击没有 id 和 name 的提交按钮? 最佳答案 我已经找到了此类场景的答案,代码如下: agent = Mechanize.new
这个问题不太可能对 future 的访客有帮助;它只与一个小的地理区域、一个特定的时刻或一个非常狭窄的情况相关,通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the hel
我一直在尝试使用以下方法从终端运行 ruby 文件: ruby file_cleanse_auto.rb 但是我从 mechanize 得到一个错误: /Library/Ruby/Site/2.0
这是我拥有的代码: agent = Mechanize.new page = agent.get 'http://google.com' page.save 'google_index.htm' 我怎
for link in br.links(url_regex="inquiry-results.jsp"): cb[link.url] = link for page_link in cb.v
我有一个登录表单的页面。登录后有一些重定向。第一个看起来像这样: #"no-cache=\"set-cookie\"", "content-length"=>"114", "set-cookie"=>
我正在尝试使用基本身份验证访问 API。它适用于 HTTParty,但不适用于 2.7.6 Mechanize。 这是我尝试过的: agent = Mechanize.new agent.log =
我正在尝试使用 Ruby 的 Mechanize gem 提交表单。此表单有一组名为“KeywordType”的单选按钮。各个按钮的名称类似于 rdoAny、rdoAll 和 rdoPhrase。使用
我是一名优秀的程序员,十分优秀!