Je cherche depuis quelque temps a faire un ti robot mais assez complet pour mon/mes futur site(s) web , j'ai trouver sur le forum un robot mais qui marche avec un connection socket bref pas du tout ce qu'il me faut. J'ai trouvé ce script.
Je vais faire un site qui seras un annuaire de lien de tout les sites touchant au modélise
Il faut donc que le robot puisse ce balader sur le net comme le robot google par exempl.
Je voudrais donc savoir qu'elle sont les possibilité rélle de ce robot, car chez moi perl me dit
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Erreur CGI L'application CGI spécifiée n'a pas renvoyé le jeu complet d'en-têtes HTTP.Voila un no
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 #!/usr/bin/perl -w use strict; my $VERSION = "0.82"; use LWP::UserAgent; use HTML::LinkExtor; use URI::URL; $| = 1; sub spider (%); spider URL => '$url'; sub spider (%) { my %args = @_; my @startlinks = (); push(@startlinks, $args{URL}); my $ua = LWP::UserAgent->new; WORKLOOP: while (my $link = shift @startlinks) { for (my $i = 0; $i< $#startlinks; $i++) { next WORKLOOP if $link eq $startlinks[$i]; } print ">>>>> working on $link\n"; HTML::LinkExtor->new( sub { my ($t, %a) = @_; my @links = map { url($_, $link)->abs() } grep { defined } @a{qw/href img/}; # mark already spidered links for removal foreach my $start_link (@startlinks) { my $i = 0; for (0 .. $#links) { if ($links[$i++] eq $start_link) { $links[$i -1] = "'REMOVE'"; } } } @links = sort @links; for (my $i = 0; $i< $#links; $i++) { $links[$i] = "'REMOVE'" if $links[$i] eq $links[$i +1]; } @links = grep { $_ ne "'REMOVE'" } @links; print "+ $_\n" foreach @links; push @startlinks, @links if @links; } ) -> parse( do { my $r = $ua->simple_request (HTTP::Request->new("GET", $link)); $r->content_type eq "text/html" ? $r->content : ""; } ) } }uveau threads tu beau tout neuf
Partager