Hello, thanks but for some reason this did not seem to work. Though it is probably something I am doing wrong.
here is my code
#!c:/strawberry/perl/bin/perl.exe use HTML::TokeParser; use HTML::Element; use HTML::TreeBuilder; use warnings; open(MYINPUTFILE, '<C:\acs\SA\content\acs\meetings\expositions\CNBP_ +028491'); while(<MYINPUTFILE>) { my $text = $_; my $html = HTML::TreeBuilder->new_from_content("$text") || die "$@\n +"; sub to_text { if (ref $_[0] eq "HTML::Element") { foreach my $sub_element ($_[0]->content_list) { &to_text($sub_element); } } else { print qq{text="$_[0]"}; } } &to_text($html); }
any other thoughts or did I miss something? Thanks again
In reply to Re^2: Parsing and converting HTML
by tevolo
in thread Parsing and converting HTML
by tevolo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |