Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Fetch URL Contents to File Handle

by haukex (Archbishop)
on Jun 09, 2020 at 08:19 UTC ( [id://11117856]=note: print w/replies, xml ) Need Help??


in reply to Fetch URL Contents to File Handle

A little bit of research on that site shows that getting the "top 10" is as easy as using the URL https://tranco-list.eu/download/K3VW/10. You can also register an account to customize the download even further.

use warnings; use strict; use HTTP::Tiny; use Text::CSV qw/csv/; # also install Text::CSV_XS for speed my $resp = HTTP::Tiny->new->get( 'https://tranco-list.eu/download/K3VW/10'); $resp->{success} or die "$resp->{status} $resp->{reason}\n"; my $topten = csv(in=>\$resp->{content}); use Data::Dump; dd $topten; __END__ [ [1, "google.com"], [2, "facebook.com"], [3, "youtube.com"], [4, "netflix.com"], [5, "microsoft.com"], [6, "twitter.com"], [7, "tmall.com"], [8, "instagram.com"], [9, "qq.com"], [10, "linkedin.com"], ]

Replies are listed 'Best First'.
Re^2: Fetch URL Contents to File Handle
by marto (Cardinal) on Jun 09, 2020 at 08:32 UTC

    Research ++. Answers like this always cheers me up. Answers that take a step back and achieve the goal in a fast and efficient way without assuming the question provides all relevant information.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117856]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found