Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 16th, 2008, 03:14 PM
Newbie
 
Join Date: Jul 2008
Posts: 10
Default get the text out of an HTML code

Dear All,

There is an HTML code and I want to collect all the text from it for example: <code> text </code>.
I thought this was simple: ... $line =~ /\>([^<>]+)\</g ... but this code just does not work.
Please help me. Thank you.

Gábor Szepes
Reply
  #2  
Old August 16th, 2008, 10:11 PM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 833
Default

HTML::Parser or HTML-TokeParser-Simple would much easier and will not be a maintenance headache. Which is what I suggested in this thread.

--Kevin
Reply
  #3  
Old August 23rd, 2008, 04:47 PM
Newbie
 
Join Date: Jul 2008
Posts: 10
Default

Hi,

Thank you for your suggestion I started to get to know the HTML Parser but I have a question on it. This Parser have subroutines like: text, comment, start and end. And all of these subroutines have variables. My question would be: how can I print out the values of these variables? (I tried the simple e.g. "print $self" command but it returns: "HASH(0x8152b44)".)
Please help me. Thank you.

Gábor
Reply
  #4  
Old August 23rd, 2008, 05:37 PM
Newbie
 
Join Date: Jul 2008
Posts: 10
Default

Hi,

Sorry for disturbing the forum. Everything is clear.

Gábor
Reply
  #5  
Old August 23rd, 2008, 07:43 PM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 833
Default

You are not bothering us. This is what we are here for. I hope you got everything sorted out correctly.

--Kevin
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles