Menu

Urgent help Required regarding Nodes in HTML

Help
chinmin2
2005-12-05
2013-04-27
  • chinmin2

    chinmin2 - 2005-12-05

    Hi all,
    I have been using Html Parser from 2-3 weeks and this is really amazing. I have gone through all the docs and sample programs and could implement it to my own project.
    But I am stuck up with one thing and I need your help.
    I have gone through link extraction using node filter. I have written my own node filter for extracting only some of the links. But what I want is I have different links belonging to different nodes i.e. some of the links are in one table and the other one in the other nodes.
    I want to compare the size of the nodes, so how do I that ?
    Is it possible to access the nodes in the LinkExtractor using Node Filter like ... node[1], node[2] size??
    I know the size method would be useful but how do I get the size of the parent of the link?
    Long question....but I need your help.
    Thanks in advance

     
    • Derrick Oswald

      Derrick Oswald - 2005-12-05

      The number of nodes is getParent().getChildren().size().

      The number of characters is (getParent().getEndPosition() - getParent().getStartPosition()).

       
    • chinmin2

      chinmin2 - 2005-12-05

      Thanks for your quick reply. It works for me!
      But I was wondering about one thing.
      How do I take out some tables from the html page.
      I need to search the html page for some comments and then the tables lying between those comments are to be excluded for further coding! How do I do that?
      Plz help me!
      Thanks in Advance

       
    • Derrick Oswald

      Derrick Oswald - 2005-12-06

      I think you need a filter.
      Look at the FilterBuilder application (bin/filterbuilder). It has help and a tutorial.

      You might need to make your own filter for Remarks though. See the other examples in the filters package.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.