[英]WWW::Mechanize timeout - all urls timing out
我在使用 WWW::Mechanize 時遇到問題。 似乎無論我嘗試訪問哪個網站,我的腳本都只是在命令提示符下坐在那里,直到它超時。 唯一想到的可能相關的事情如下:
這是一個例子:
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
my $url = 'http://docstore.mik.ua/orelly/perl/learn/';
my $mech = WWW::Mechanize->new();
$mech->get( $url );
print $mech->content;
該代碼似乎有效,因此它一定是防火牆/代理問題。 您可以嘗試設置代理:
$mech->proxy(['http', 'ftp'], 'http://your-proxy:8080/');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.