Parsing HTML page with HTML Dom or jquery

I need to parse the HTML content such that every header has its content as provided in <li> tags. Any pointers would be appreciated. My HTML generated is like below


Testing Time: 2015-10-29 17:57:11
Total Age: 19
Total Friemd: 9
Total Family: 10

Here are the suggestions - Him_530037_: 93358546

Overview


  • (The overlap provided is not good)

Structure


Target:


  • Audience.
  • Lookalike
  • Overlap of Audience

The results should be:

Overview:The Overlap provided is not good
Structure:
Target: Audience, Lookalike, Overlap of audience

I was thinking something on these lines, but not able to move forward

        nodes = document.getElementById("word_content");
        var $result = new Array();
        for (i=0; i < nodes.childNodes.length; i++) 
        { 
            if (nodes.childNodes[i].nodeValue !=null) 
                {
                    $result[i]= nodes.childNodes[i].nodeValue;
                }
        }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s