#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use WWW::Moreshet; my %opts; usage() if not @ARGV; GetOptions(\%opts, 'user=s', 'password=s', 'help', ) or usage(); usage() if $opts{help}; usage() if not $opts{user} or not $opts{password}; my $w = WWW::Moreshet->new(); $w->get_login_page; save_content($w, "01_login_page.html"); $w->login($opts{user}, $opts{password}); save_content($w, "02_main.html"); my $url = 'http://safe.moreshet.co.il'; $w->{w}->get("$url/statnew.asp"); save_content($w, "03_list_states.html"); $w->{w}->get("$url/add.asp"); save_content($w, "04_add_form.html"); $w->{w}->get("$url/doseek.asp"); save_content($w, "05_list_sites.html"); $w->{w}->get("$url/doseek.asp"); save_content($w, "06_search_sites.html"); sub save_content { my ($w, $filename) = @_; open my $fh, '>', $filename or die; print {$fh} $w->{w}->content; } sub usage { print <<"END_USAGE"; Moreshet site scrap $WWW::Moreshet::VERSION Usage: $0 --help --user USERNAME --password PASSWORD END_USAGE exit; }