- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Mechanize 获取 https,但失败了:
use strict;
use warnings;
use IO::Socket::SSL;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new;
$mech->proxy(['https','http'], 'http://proxy:8080/');
$mech->get('https://www.google.com');
print $mech->content;
Error GETing https://www.google.com: Bad Request at perl4.pl line 9.
LWP::UserAgent
我可以毫无错误地获取 https:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->proxy(['https','http'], 'http://proxy:8080/');
$ua->get('https://www.google.com');
最佳答案
WWWW::Mechanize 基于 LWP::UserAgent,多年来它对 https 代理请求有一个奇怪的想法,例如它不是使用 CONNECT 请求来构建隧道然后升级到 SSL,而是发送带有 https-URL 的 GET 请求。
见 https://rt.cpan.org/Ticket/Display.html?id=1894
一个修复终于合并到了libwwww-perl github仓库,但是不知道什么时候会发布新版本的LWP。与此同时,您可能会使用 Net::SSLGlue::LWP,它会修补 LWP 以提供对 https 代理的适当支持(我是 Net::SSLGlue::LWP 和 LWP 修复程序的作者)。
关于perl - Active perl 机械化错误请求错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18712307/
我正在尝试制作一个 perl 脚本来向我创建的应用程序发送获取请求。我的应用程序在不同的服务器上运行,所以为了让它看起来像一个域,我将 ip 添加到我的/etc/hosts 文件中。我的主机文件如下所
我正在尝试使用机械化从 metacriti* 网站抓取一些数据,但我没有得到任何输出 这是我的带有 url 示例的代码: my $metaURL = "http://www.metacriti*.co
我正在尝试使用 mechanize 登录网站。下面是提交时的 javascript 操作。我可以破译它在做什么并通过机械化来实现吗?人们一直建议我可以找出 javascript 的作用并尝试复制它,但
好吧,我正在尝试为我的旅馆 wifi 创建一个自动登录脚本,我需要登录到 wifi 才能获得网络访问权限。如果我连接到 wifi,该网页在本地网络上保持打开状态。我只需要访问该网页并在那里登录即可。所
我试着写了下面的代码,我正在尝试写一个Python 3.7中的代码只是打开一个网络浏览器,网站在 Command Line 中提供给它: 示例.py import sys from mechanize
我正在尝试使用程序 fbruteforcer.py。我编译了它,它似乎有效但根本无效。 以下作品: ./wpbruteforcer.py -t www.pillolhacking.net -u adm
我是一名优秀的程序员,十分优秀!