D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
perl-HTML-Parser
/
eg
/
Filename :
htext
back
Copy
#!/usr/bin/perl -w # Extract all plain text from an HTML file use strict; use HTML::Parser 3.00 (); my %inside; sub tag { my($tag, $num) = @_; $inside{$tag} += $num; print " "; # not for all tags } sub text { return if $inside{script} || $inside{style}; print $_[0]; } HTML::Parser->new(api_version => 3, handlers => [start => [\&tag, "tagname, '+1'"], end => [\&tag, "tagname, '-1'"], text => [\&text, "dtext"], ], marked_sections => 1, )->parse_file(shift) || die "Can't open file: $!\n";;
Name
Size
Last Modified
Owner
Permissions
Actions
hanchors
1.111
KB
October 21 2013 5:44:45
root
0644
hdump
0.528
KB
October 21 2013 5:44:45
root
0644
hform
1.803
KB
October 21 2013 5:44:45
root
0644
hlc
0.534
KB
October 21 2013 5:44:45
root
0644
hrefsub
2.717
KB
October 21 2013 5:44:45
root
0644
hstrip
1.674
KB
October 21 2013 5:44:45
root
0644
htext
0.535
KB
October 21 2013 5:44:45
root
0644
htextsub
0.77
KB
October 21 2013 5:44:45
root
0644
htitle
0.424
KB
October 21 2013 5:44:45
root
0644
2017 © D7net | D704T team