For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2007 > parsing html data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author parsing html data
Xavier Mas

2007-05-22, 6:59 pm

dear all,

I'm trying to make a consult to a online dictionary from an html document, the
result of the consult has to be output in a text field of the same html
document.

I understand this can be done using (perl) cgi scripts but am not sure which
module do I need for that.

Any suggestions?


--
Xavier Mas
David Moreno Garza

2007-05-22, 6:59 pm

xavier mas wrote:
> dear all,
>
> I'm trying to make a consult to a online dictionary from an html document, the
> result of the consult has to be output in a text field of the same html
> document.
>
> I understand this can be done using (perl) cgi scripts but am not sure which
> module do I need for that.


A number of modules around LWP can help you with it. WWW::Mechanize,
specifically, can help you with its specific method, content():

$mech->content(format => 'text');

--
David Moreno Garza <damog@ciencias.unam.mx> | http://www.damog.net/
<URL:http://pub.tsn.dk/how-to-quote.php>

Xavier Mas

2007-05-22, 6:59 pm

El Martes 22 Mayo 2007 22:00, David Moreno Garza escribi=F3:
> xavier mas wrote:
>
> A number of modules around LWP can help you with it. WWW::Mechanize,
> specifically, can help you with its specific method, content():
>
> $mech->content(format =3D> 'text');
>
> --
> David Moreno Garza <damog@ciencias.unam.mx> | http://www.damog.net/
> <URL:http://pub.tsn.dk/how-to-quote.php>


Muchas gracias, David.
=2D-=20
Xavier Mas
yaron@kahanovitch.com

2007-05-22, 6:59 pm

Hi,

If the problem is to get dictionary translation, I think you should not wor=
k directkly with LWP or WWW::Mechanize.
Those modules provides convinient way to get the answer in HTML. This will =
force you to hack html files.

Altwernatively, you can use dictionaries that provides API like www.diction=
ary.com (and use the perl module WWW::Dictionary http://search.cpan.org/~co=
g/WWW-Dictionary-0.01/lib/WWW/Dictionary.pm) or even wikipedia (WWW::Wikipe=
dia at http://search.cpan.org/~bricas/WWW-...WWW/Wikipedia.=
pm).

You can manu more dictionaries in the cpan.

Yaron Kahanovitch


----- Original Message -----
From: "xavier mas" <xaviermasr@ya.com>
To: beginners@perl.org
Sent: 22:14:07 (GMT+0200) Africa/Harare =D7=99=D7=95=D7=9D =D7=A9=D7=9C=D7=
=99=D7=A9=D7=99 22 =D7=9E=D7=90=D7=99 2007
Subject: Re: parsing html data

El Martes 22 Mayo 2007 22:00, David Moreno Garza escribi=C3=B3:
> xavier mas wrote:
>
> A number of modules around LWP can help you with it. WWW::Mechanize,
> specifically, can help you with its specific method, content():
>
> $mech->content(format =3D> 'text');
>
> --
> David Moreno Garza <damog@ciencias.unam.mx> | http://www.damog.net/
> <URL:http://pub.tsn.dk/how-to-quote.php>


Muchas gracias, David.
--=20
Xavier Mas

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/



Xavier Mas

2007-05-23, 6:59 pm

El Martes 22 Mayo 2007 22:38, yaron@kahanovitch.com escribi=C3=B3:
> Hi,
>
> If the problem is to get dictionary translation, I think you should not
> work directkly with LWP or WWW::Mechanize. Those modules provides
> convinient way to get the answer in HTML. This will force you to hack html
> files.
>
> Altwernatively, you can use dictionaries that provides API like
> www.dictionary.com (and use the perl module WWW::Dictionary
> http://search.cpan.org/~cog/WWW-Dic...W/Dictionary.pm) or
> even wikipedia (WWW::Wikipedia at
> http://search.cpan.org/~bricas/WWW-...WW/Wikipedia.pm).
>
> You can manu more dictionaries in the cpan.
>
> Yaron Kahanovitch
>
>
> ----- Original Message -----
> From: "xavier mas" <xaviermasr@ya.com>
> To: beginners@perl.org
> Sent: 22:14:07 (GMT+0200) Africa/Harare =D7=99=D7=95=D7=9D =D7=A9=D7=9C=

=D7=99=D7=A9=D7=99 22 =D7=9E=D7=90=D7=99 2007
> Subject: Re: parsing html data
>
> El Martes 22 Mayo 2007 22:00, David Moreno Garza escribi=C3=B3:
of[color=darkred]
>
> Muchas gracias, David.
> --
> Xavier Mas
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/


Thank you yaron, I know this, but the purpose is to do an apps that makes=20
that.

Greetings,
=2D-=20
Xavier Mas
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com