[求助]抓取网页内容时被禁要怎么办

[求助]抓取网页内容时被禁要怎么办



[Copy to clipboard] [ - ]
CODE:
1 #!/usr/bin/perl -w
  2 use LWP;
  3 use Encode qw/from_to decode encode/;
  4 use strict;
  5
  6 my $ua = LWP::UserAgent->new;
  7 $ua->cookie_jar({-file=>"./cookie"});
  8 $ua->proxy(['http'],'http://10.71.115.253:3128');
  9 my $url = 'http://news.google.cn/news?hl=zh-CN&ned=ccn&ie=UTF-8&q=%E7%94%9F%E7%89%A9&as_drrb=q&as_qdr=h';
10 my $page = $ua->get($url);
11
12
13 print $page->content;

就上面的url='http://news.google.cn/news?hl=zh-CN&ned=ccn&ie=UTF-8&q=%E7%94%9F%E7%89%A9&as_drrb=q&as_qdr=h',是google旗下的一个网页,
抓它时,内容部分显示:
<H1>Forbidden</H1>
Your client does not have permission to get URL <code>/news?hl=zh-CN&ned=ccn&ie=UTF-8&q=%E7%94%9F%E7%89%A9&as_drrb=q&as_qdr=h</code> from this server.
这要怎么办呀,求助达人解答
顶下
问题已解决。。。只要把代码写在浏览在访问就行了


QUOTE:
原帖由 chenxiam 于 2008-3-15 14:54 发表
问题已解决。。。只要把代码写在浏览在访问就行了

可以看看代码吗?