Hello Guys,
It was all my mistake. The file's name I wanted to parse was x.htm and not x.html.
Sorry for bothering the forum.
I am new to perl I thought that there is a much complex problem.
Sorry again.
Gábor
User Profile
Collapse
-
Hello,
This is the code I used:
...Code:#!/usr/bin/perl -w use strict; # define the subclass package IdentityParse; use base "HTML::Parser"; open(OUT,">placid.html"); sub text { my ($self, $text) = @_; # just print out the original text print OUT $text; }Leave a comment:
-
I forgot to mention that if I am working with a much simpler file e.g. an HTML file that has only 5 or 6 rows then everything is fine.
GáborLeave a comment:
-
Perl HTML Parser does not work
Hi!
If I want to parse this html file (e.g. copy it into an other file using HTML Parser) I only get an empty file.
What am I doing wrong?
Thank you for your answer in advance.
Gábor -
Hi,
Sorry for disturbing the forum. Everything is clear.
GáborLeave a comment:
-
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.
...Leave a comment:
-
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 -
find something in a text
Dear Readers,
The word "hide" appeares in a text several times. I want find one of them and then before it I want ot find the nearest unangle bracketed area to it (so an area without angle brackets). (This is an html code that I have to process. This is the reason for the angle brackets.)
Thank you for you answer in advance.
Gábor Szepes
ps: if something is not clear ask me -
-
how to count certain words
Hello All!
There is a text I want to process. The name Horch appeares 4 or 5 times. The question is: how can I count the number of appearences with a Perl program?
Thank you for your answer in advance.
Gábor Szepes
No activity results to display
Show More
Leave a comment: