lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppuyen <khongkh...@mail.ru>
Subject Get element Class DOM !!!!
Date Tue, 13 Jan 2009 17:27:40 GMT

hi everyone, 
I run example Indexing files HTML from "Lucene in Action " . 
there can getTitle and getBody of file HTML . 

protected String getTitle(Element rawDoc) { 
    if (rawDoc == null) { 
      return null; 
    } 
    //System.out.println("getTitle"); 
    String title = ""; 
    NodeList children = rawDoc.getElementsByTagName("title"); 
    if (children.getLength() > 0) { 
      Element titleElement = ((Element) children.item(0)); 
      Text text = (Text) titleElement.getFirstChild(); 
      if (text != null) { 
        title = text.getData(); 
      } 
    } 
        System.out.println("getTitle:"+ title); 
    return title; 
  } 


My project is commercial search engine. it's mean. when i find one product
(example  Nokia N72 ) . after click button "Submit" , the result need show 
name of product and Price each shop. 
 I run file Indexing file HTML , there're can  getTitle and getBody. 
My problem now is get Class ( example :   $40 < /b> ) . 
but each web's Class name  is different . 
Help me how could i do ? 
thanks so much. 


-- 
View this message in context: http://www.nabble.com/Get-element-Class-DOM-%21%21%21%21-tp21440406p21440406.html
Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message