[26372] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8544 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 19 18:05:31 2005

Date: Wed, 19 Oct 2005 15:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 19 Oct 2005     Volume: 10 Number: 8544

Today's topics:
    Re: HTML::TokeParser <dvh@dvhdvhdvhdvdh.dvh>
    Re: HTML::TokeParser <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 19 Oct 2005 20:23:52 +0000 (UTC)
From: "DVH" <dvh@dvhdvhdvhdvdh.dvh>
Subject: Re: HTML::TokeParser
Message-Id: <dj6a0n$7a8$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>


A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in message
news:Xns96F1B3F245A6asu1cornelledu@127.0.0.1...
> "DVH" <dvh@dvhdvhdvhdvdh.dvh> wrote in
> news:diug96$jfj$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com:
>
> >
> > Stephen Hildrey <steve@uptime.org.uk> wrote in message
> > news:1129484153.30203.0@doris.uk.clara.net...
> >> DVH wrote:
> >> > I'm trying to get tokeparser to fetch a series of hyperlinks and
> >> > print the URL followed by the link text.
> >> >
> >> > The following script ("eurofeed.pl") gives me "Can't coerce array
> >> > into hash at eurofeed.pl line 31"
> >> >
> >> > Line 31 is "if ($tag->[2]{class} and $tag->[2]{class} eq
> > 'docSel-titleLink')
> >>
> >> You probably want ->[1] rather than ->[2]
> >
> > I did. I had thought it would be tag[2] because I was looking for the
> > third tag within those brackets, but obviously not.
> >
> > Thank you, that now works. I have a couple more questions (ah they
> > always do...)
> >
> > Firstly, the HTML puts a lot of whitespace in the middle of the hrefs.
>
> ITYM "the HTML contains".
>
>
> > Is there a reasonably simple way of getting rid of that? The site is
> > at
> > http://europa.eu.int/rapid/recentPressReleasesAction.do?
> guiLanguage=en&
> > hits= 10 if you need to see it.
> >
> > Secondly, I'm working towards getting following those hrefs and then
> > parsing the text I find there. Would I be better off using
> > WWW::Mechanize to do this?
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use HTML::LinkExtractor;
> use LWP::Simple;
>
> my $url = q{http://europa.eu.int/rapid/recentPressReleasesAction.do?
> guiLanguage=en};
> my $html = get $url;
>
> die "Cannot get <$url>\n" unless $html;
>
> my $lx = HTML::LinkExtractor->new;
> $lx->parse(\$html);
>
> use Data::Dumper;
>
> for my $link ( @{ $lx->links } ) {
>    if ($link->{class} eq 'docSel-formatLink') {
>       print Dumper $link;
>    }
> }
>
>
> __END__

Sorry for getting back to you three days late, but thanks to both of you.




------------------------------

Date: Wed, 19 Oct 2005 20:34:49 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: HTML::TokeParser
Message-Id: <Xns96F4A8AC0703Casu1cornelledu@127.0.0.1>

"DVH" <dvh@dvhdvhdvhdvdh.dvh> wrote in news:dj6a0n$7a8$1
@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com:

> A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in message
> news:Xns96F1B3F245A6asu1cornelledu@127.0.0.1...
 ...
> Sorry for getting back to you three days late, but thanks to both
> of you.

You are welcome. Hope it helped.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8544
***************************************


home help back first fref pref prev next nref lref last post