473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use HTML::Parser to remove HTML tags and print result

I am trying to use HTML::Parser to parse an HTML file, remove all HTML tags
(including comments, etc.), replace all ENTITIES (e.g. &amp), and put the
result into a variable as a string. I figure HTML::Parser itself can
somehow preform the filtering, but how do I get it back as a string? I'd
appreciate some sample code if anyone has any. Sorry if this is a real n00b
question.

Thanks a lot,
Mitchua

Jul 19 '05 #1
1 11905

"Mitchua" <mi*****@yahoo.com> wrote in message
news:pv********************@news01.bloor.is.net.ca ble.rogers.com...
I am trying to use HTML::Parser to parse an HTML file, remove all HTML tags (including comments, etc.), replace all ENTITIES (e.g. &amp), and put the
result into a variable as a string. I figure HTML::Parser itself can
somehow preform the filtering, but how do I get it back as a string? I'd
appreciate some sample code if anyone has any. Sorry if this is a real n00b question.

Thanks a lot,
Mitchua


Try this for a sample of parsing a webpage
http://www.wdvl.com/Authoring/Langua...ummarizer.html
If you are just trying to remove all the html tags, you could just do this
$webpage =~ s/<.*?>//g;

Ice Demon
http://adult-xxx-newsgroups.com
http://adult-cybergames.com
http://adult-spider.com
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2710
by: Himanshu Garg | last post by:
Hello, I am using HTML::Parser to extract text from html pages from http://bbc.co.uk/urdu/ However the encoding of the input text seems to change to some unknown encoding in the output. The...
2
5880
by: Divya Rao | last post by:
Hi, I need to parse a HTML file, and extract all the text in it (not the images, tags). I cannot figure out how to do it. I have the HTML file saved in my local directory. I need to have the text...
3
7710
by: Mark | last post by:
Hi, I am using a program that is ultra paranoid about start and end html tags. For example <p>This is a test <br>A new line The above code causes the program to fail
6
2813
by: wilk | last post by:
Is anybody know here any class in .NET that would help me to parse html in C# ? Or maybe you can even tell me how to do it? -- -- -------------------------------------- Pozdrawiam WILK...
14
3116
by: WUV999U | last post by:
Hi I am fairly familiar in C but not much. I want to know how I can write a html parser in C that only parses for the image file in the html file and display or print all the images found in...
7
3627
by: majid | last post by:
I want write a program with c# to pars a html file how ccan i do this with system.mshtml? or there is other way to do it p;ease help me?
5
1407
by: Just Another Victim of the Ambient Morality | last post by:
I'm trying to parse HTML in a very generic way. So far, I'm using SGMLParser in the sgmllib module. The problem is that it forces you to parse very specific tags through object methods like...
0
882
by: Rama Jayapal | last post by:
can anyone solve my problem i have developed a webapplication where i have parsed the contents of the webpage using MILHTML parser from codeproject.com i have the document now in html...
2
1577
by: Chris | last post by:
Can anyone recommend a good HTML/XHTML parser, similar to HTMLParser.HTMLParser or htmllib.HTMLParser, but able to intelligently know that certain tags, like <br>, are implicitly closed? I need to...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.