![]() |
|
[TUT] Perl Searching a webpage [Beginner LVL 5] - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: [TUT] Perl Searching a webpage [Beginner LVL 5] (/Thread-TUT-Perl-Searching-a-webpage-Beginner-LVL-5) |
[TUT] Perl Searching a webpage [Beginner LVL 5] - FrostByte_mybb_import5923 - 05-10-2011 hey everyone, another perl tutorial here. This tutorial will be covering how to search a webpage for content. This can be very usful as it can be quickly adapted to find thing's like e.g. my sql error for sql injection. this tutorial will be showing you if a page contains the text "search". full code Code: use LWP::Simple qw(get);
use HTTP::Request;
print"--- # Item Finder # ---\n\n\n";
print"Url: ";
my $url = <STDIN>;
my $content = get $url;
die "Unable to find $url" unless defined $content;
if ($content =~ "search") {
print"Page containes search";
} else {
print"search not found";
}explained. Code: use LWP::Simple qw(get);
use HTTP::Request;Code: print"--- # Item Finder # ---\n\n\n";
print"Url: ";Code: my $url = <STDIN>;Code: my $content = get $url;
die "Unable to find $url" unless defined $content;Code: if ($content =~ "search") {
print"Page containes search";
} else {
print"search not found";
}as said on another tutorial this just says, if our page source contains the word "search" then print"page contains search" else print"search not found" thanks for reading hoped this helped you. |