|
From: kentweb on 3 Feb 2007 10:42 I would like to use a PERL script to logon to a web site, navigate web pages, select links for files to be downloaded, then receive the files. The names of the files will be dynamic changing daily. The reason I want to use PERL to do this is to automate the process so a person doesn't have to do it. Does anyone have an example script that does something like this? Thank you.
From: Henry Law on 3 Feb 2007 13:18 kentweb(a)goxroads.com wrote: > I would like to use a PERL script to logon to a web site, navigate web > pages, select links for files to be downloaded, then receive the > files. The names of the files will be dynamic changing daily. The > reason I want to use PERL to do this is to automate the process so a > person doesn't have to do it. Does anyone have an example script that > does something like this? First a piece of advice: read the posting guidelines for this group before you post again. It will help you get better answers (and get a more pleasant time, for reasons that the guidelines explain). To do what you want will require use of various Perl (not PERL) modules, which will probably include WWW::Mechanize; CPAN will tell you what it can do and how to do it; you can also download it from there if you need to. Use this URL to find examples of how to use it http://www.google.com/search?hl=en&q=perl+mechanize+sample Also possible is LWP::Simple which does more simple things (surprise!) but is very easy to use and powerful enough for many purposes. Here's a fragment to give you an idea (untested, not syntax checked) use strict; use warnings; use LWP::Simple; my $url = "http://www.example.com"; my $html_source = get $url or die "Aaaaagh:$!"; # process the HTML text (there are Perl modules to help there too) my $target_url = "http://www.example.com/some/address/on/target"; my $downloaded_file = get $target_url or die "Aiieee:$!"; open DOWN,'>',"/some/local/file" or die "Couldn't open:$!"; binmode DOWN; print DOWN $downloaded_file; close DOWN; Go try something, write some code; start simple - leave out the logging in stuff first, just see if you can download a known file. Post here if you can't make it work. Then add other functions as you get more confident. -- Henry Law Manchester, England
From: fishfry on 3 Feb 2007 22:45 In article <1170526708.12949.0(a)proxy00.news.clara.net>, Henry Law <news(a)lawshouse.org> wrote: > kentweb(a)goxroads.com wrote: > > I would like to use a PERL script to logon to a web site, navigate web > > pages, select links for files to be downloaded, then receive the > > files. The names of the files will be dynamic changing daily. The > > reason I want to use PERL to do this is to automate the process so a > > person doesn't have to do it. Does anyone have an example script that > > does something like this? > > First a piece of advice: read the posting guidelines for this group > before you post again. It will help you get better answers (and get a > more pleasant time, for reasons that the guidelines explain). > I've noticed that weekend volume is now down to less than 60 posts per day. I think the Perl Usenet community has made its point by being so inhospitable to newcomers over the years. And if you check out Craigslist job listings for Perl, you'll see those are on the downslide too. How "there's more than one way to do it" morphed into "don't post here till you've spent the day reading perldocs," is a sad story, in my personal opinion.
From: Uri Guttman on 3 Feb 2007 23:55 >>>>> "f" == fishfry <BLOCKSPAMfishfry(a)your-mailbox.com> writes: f> I've noticed that weekend volume is now down to less than 60 posts per f> day. I think the Perl Usenet community has made its point by being so f> inhospitable to newcomers over the years. And if you check out f> Craigslist job listings for Perl, you'll see those are on the downslide f> too. ever look at the volume on the perl jobs list? it has steadily rose over several years now. anyone who know will post there instead of craig's list as it is subscribed to by perl hackers from all over the world. and craig's list charges for job postings in some cities now (boston for sure). so your source of data is not that useful. the issue is more like usenet overall is slowing down. or most newbies find it from google and think it is a google service. also there are dozens of topic specific perl mailing lists (see lists.perl.org), the perl beginner's list, perlmonks, local monger lists, other bulletin boards competing for perl discussions. so next time you feel like indirectly flaming this group, please have some more accurate facts behind you. the perl community isn't dying by any measure, just its usenet slice is smaller by bit. uri -- Uri Guttman ------ uri(a)stemsystems.com -------- http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
From: John Bokma on 4 Feb 2007 01:17
Uri Guttman <uri(a)stemsystems.com> wrote: > the issue is more like usenet overall is slowing down. Are there any solid numbers on that? I've been hearing the death of Usenet for many years. What I have seen in those years was that more groups got added. And yes, that thins out things. > or most newbies > find it from google and think it is a google service. also there are > dozens of topic specific perl mailing lists (see lists.perl.org), the > perl beginner's list, perlmonks, local monger lists, other bulletin > boards competing for perl discussions. so next time you feel like > indirectly flaming this group, please have some more accurate facts > behind you. the perl community isn't dying by any measure, just its > usenet slice is smaller by bit. No idea if that's really the case. I mean, even Purl Gurl is back :-D. -- John Experienced Perl programmer: http://castleamber.com/ Perl help, tutorials, and examples: http://johnbokma.com/perl/ |