in reply to Saving contents of a Target Link.
I have no problem like you describe:
C:\temp>perl -MLWP::Simple -e "getstore 'http://ichart.finance.yahoo.c +om/table.csv?s=AMZN&d=8&e=30&f=2004&g=d&a=4&b=16&c=1997&ignore=.csv', +'test.tmp'" C:\temp>dir test.tmp Datenträger in Laufwerk C: hat keine Bezeichnung. Datenträgernummer: 6C76-F753 Verzeichnis von C:\temp 30.09.2004 17:59 88.703 test.tmp 1 Datei(en) 88.703 Bytes 0 Verzeichnis(se), 65.836.314.624 Bytes frei C:\temp>perl -ple "exit if $.>5" test.tmp Date,Open,High,Low,Close,Volume,Adj. Close* 29-Sep-04,39.45,40.92,39.36,40.84,9918800,40.84 28-Sep-04,40.15,40.33,38.97,39.43,11902900,39.43 27-Sep-04,40.91,41.01,39.75,39.93,8397400,39.93 24-Sep-04,41.81,41.91,40.85,40.94,6205700,40.94 C:\temp>
I also don't have the problem you describe using WWW::Mechanize:
C:\temp>type mech.pl use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $tempfile="tmp.txt"; $mech->agent_alias( 'Windows IE 6' ); $url="http://ichart.finance.yahoo.com/table.csv?s=AMZN&d=8&e=30&f=2004 +&g=d&a=4&b=16&c=1997&ignore=.csv"; my $res = $mech->get( $url,":content_file"=>$tempfile ); warn $mech->status; C:\temp>perl -w mech.pl 200 at mech.pl line 7. C:\temp>perl -ple "exit if $.>5" tmp.txt Date,Open,High,Low,Close,Volume,Adj. Close* 29-Sep-04,39.45,40.92,39.36,40.84,9918800,40.84 28-Sep-04,40.15,40.33,38.97,39.43,11902900,39.43 27-Sep-04,40.91,41.01,39.75,39.93,8397400,39.93 24-Sep-04,41.81,41.91,40.85,40.94,6205700,40.94
So the problem must be somewhere else, like maybe you haven't shown us the actual code you are using, or you are not allowed to write into the current directory or some other problem... You should check what the actual result code is you get from WWW::Mechanize, maybe it is also a network problem.
|
|---|