in reply to Re^3: Issue With WWW::Mechanize
in thread Issue With WWW::Mechanize
thanks for you advice, praveenzx~#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTML::TreeBuilder; use Data::Dumper; my $mech = WWW::Mechanize->new(); my $url = 'http://www.etfsecurities.com/en/etfscalculations/etfsmsl.as +px?region=us'; $mech->agent_alias('Windows Mozilla'); $mech->add_header('Host' => 'www.etfsecurities.com'); $mech->add_header('Accept' => 'text/html,application/xhtml+xml,applica +tion/xml;q=0.9,*/*;q=0.8'); $mech->add_header('Accept-Language' => 'en-us,en;q=0.5'); $mech->add_header('Accept-Encoding' => 'gzip, deflate'); $mech->add_header('Connection' => 'keep-alive'); $mech->add_header('Cache-Control' => 'private'); $mech->add_header('Content-Type' => 'text/html; charset=utf-8'); $mech->get($url); print $mech->content(); open(WRT,">praveenzx.htm"); print WRT $mech->content(); close(WRT);
|
|---|