Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > HTML parser

Reply
Thread Tools

HTML parser

 
 
ABAKUS
Guest
Posts: n/a
 
      06-03-2004
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);
}





 
Reply With Quote
 
 
 
 
JavaJug
Guest
Posts: n/a
 
      06-03-2004
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
 
Reply With Quote
 
 
 
 
Pavel L.Yatsuk
Guest
Posts: n/a
 
      06-04-2004
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);
> }
>
>
>
>
>

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-04-2004
On Thu, 3 Jun 2004 09:48:53 +0200, "ABAKUS" <(E-Mail Removed)>
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.
 
Reply With Quote
 
William Brogden
Guest
Posts: n/a
 
      06-05-2004
On Fri, 04 Jun 2004 13:32:33 +0300, Pavel L.Yatsuk <(E-Mail Removed)>
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 =---
 
Reply With Quote
 
Rogan Dawes
Guest
Posts: n/a
 
      06-07-2004
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 http://www.velocityreviews.com/forums/(E-Mail Removed) will be dropped, and added
to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"
 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Load HTML in text strings into HTML parser in Javascript David Virgil Hobbs HTML 2 04-09-2006 01:21 PM
XML Parser VS HTML Parser ZOCOR Java 11 10-05-2004 01:58 PM
HTML-Parser / SGML-Parser Zach Dennis Ruby 5 10-01-2003 07:26 PM
Re: re or html parser module, for wildcard search within html document? Bengt Richter Python 0 08-03-2003 05:49 AM
How to use HTML::Parser to remove HTML tags and print result Mitchua Perl 1 07-15-2003 02:02 PM



Advertisments