use utf8;
use File::Find;
use HTML::Strip;
my $hs = HTML::Strip->new();

$root_dir="/home/crawling_seoautoscaler/www.dreizweieins.ch/";
find(\&wanted, $root_dir);
$hs->eof;

sub wanted { 
	$file = $File::Find::name;
	open(ONT,'<:encoding(UTF-8)',"<$file") or die; # '<:encoding(utf8)', 
	undef $/;
	$content = <ONT>;
	close ONT;

	my ($marke_tmp) = ( $content =~ m{<div id="content_area" data-container="content">(.*?)<script id="cc-m-reg-12653736949"}msi );
	my $clean_text = $hs->parse( $marke_tmp );
	open(L,'>:encoding(latin1)',">/home/seo-auto-scaler/version3/extractor/dreizweieins/$count.txt"); # '+>>:encoding(utf8)',
	print L $clean_text;
	close L;
};