Download files with Perl

后端 未结 2 1654
南笙
南笙 2021-01-15 16:23

I have updated my code to look like this. When I run it though it says it cannot find the specified link. Also what is a good way to test that it is indeed connecting to the

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-15 17:07

    As stated in a comment in your other question: here

    You can use the same method to retrieve .csv files as .html, or any other text-based file for the matter.

    #!/usr/bin/perl -w
    use strict;
    use LWP::Simple;
    
    my $csv = get("http://www.spc.noaa.gov/climo/reports/last3hours_hail.csv")
               or die "Could not fetch NWS CSV page.";
    

    To login, you may need to use WWW::Mechanize to fill out the webform (look at $mech->get(), $mech->submit_form(), and $mech->follow_link())

提交回复
热议问题