Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   HTML parser (http://www.velocityreviews.com/forums/t134059-html-parser.html)

ABAKUS 06-03-2004 07:48 AM

HTML parser
 
Hi, Can you help me?
I try to write html parser, but nothing unacts me unknow that make wrong. I
have found something code, but I don't know what insert before this code :
if (t == HTML.Tag.META)
{
System.out.println("Inside META tage data");

String attrib = (String) a.getAttribute (HTML.Attribute.NAME);
if (attrib != null)
{
}
String content =(String) a.getAttribute(HTML.Attribute.CONTENT);
if (content != null)
{

}
String httpequiv = (String)a.getAttribute(HTML.Attribute.HTTPEQUIV);
if (httpequiv != null)
{

}
String meta = attrib + content + httpequiv;
System.out.println(meta);
}






JavaJug 06-03-2004 08:18 AM

Re: HTML parser
 
ABAKUS wrote:

> Hi, Can you help me?
> I try to write html parser, but nothing unacts me unknow that make wrong. I
> have found something code, but I don't know what insert before this code :
> if (t == HTML.Tag.META)
> {
> System.out.println("Inside META tage data");
>
> String attrib = (String) a.getAttribute (HTML.Attribute.NAME);
> if (attrib != null)
> {
> }
> String content =(String) a.getAttribute(HTML.Attribute.CONTENT);
> if (content != null)
> {
>
> }
> String httpequiv = (String)a.getAttribute(HTML.Attribute.HTTPEQUIV);
> if (httpequiv != null)
> {
>
> }
> String meta = attrib + content + httpequiv;
> System.out.println(meta);
> }
>


You can parse html with the Swing classes of Java.
See http://www.informit.com/articles/art...=31059&redir=1

--
"There is a theory which states that if ever anyone discovers exactly what the
Universe is for and why it is here, it will instantly disappear and be replaced
by something even more bizarre and inexplicable.
There is another theory which states that this has already happened."
-- Douglas Adams

Pavel L.Yatsuk 06-04-2004 10:32 AM

Re: HTML parser
 
Hello!
You want to write parser or parse HTML file?
If last than use http://xmlc.objectweb.org/

ABAKUS wrote:
> Hi, Can you help me?
> I try to write html parser, but nothing unacts me unknow that make wrong. I
> have found something code, but I don't know what insert before this code :
> if (t == HTML.Tag.META)
> {
> System.out.println("Inside META tage data");
>
> String attrib = (String) a.getAttribute (HTML.Attribute.NAME);
> if (attrib != null)
> {
> }
> String content =(String) a.getAttribute(HTML.Attribute.CONTENT);
> if (content != null)
> {
>
> }
> String httpequiv = (String)a.getAttribute(HTML.Attribute.HTTPEQUIV);
> if (httpequiv != null)
> {
>
> }
> String meta = attrib + content + httpequiv;
> System.out.println(meta);
> }
>
>
>
>
>


Roedy Green 06-04-2004 12:34 PM

Re: HTML parser
 
On Thu, 3 Jun 2004 09:48:53 +0200, "ABAKUS" <abakus10@ko.onet.pl>
wrote or quoted :

> I try to write html parser, but nothing unacts me unknow that make wrong.


see http://mindprod.com/jgloss/parser.html


Quiotix will turn HTML into a tree you can then chase.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

William Brogden 06-05-2004 12:57 PM

Re: HTML parser
 
On Fri, 04 Jun 2004 13:32:33 +0300, Pavel L.Yatsuk <pavel@evalica.com>
wrote:

> Hello!
> You want to write parser or parse HTML file?
> If last than use http://xmlc.objectweb.org/
>
> ABAKUS wrote:
>> Hi, Can you help me?
>> I try to write html parser, but nothing unacts me unknow that make
>> wrong. I


The JTidy toolkit - http://sourceforge.net/projects/jtidy
is another possible source of inspiration for parsing HTML.
Bill


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Rogan Dawes 06-07-2004 06:44 AM

Re: HTML parser
 
ABAKUS wrote:

> Hi, Can you help me?
> I try to write html parser, but nothing unacts me unknow that make wrong. I
> have found something code, but I don't know what insert before this code :


Also have a look at HTMLParser on SourceForge.net

http://sourceforge.net/projects/htmlparser/

Rogan
--
Rogan Dawes

*ALL* messages to discard@dawes.za.net will be dropped, and added
to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.