HTML parsing?
Jun 10, 2014 at 12:26pm UTC  
The title is a 
little  misguiding, I have the following sample HTML:
1<div class ="directions" >
<h3>Directions</h3>
    <div class ="directLeft"  itemprop="recipeInstructions" >
        <div id="msgDirections"  style="display:none" ></div>
            
                <ol>
            
                <li><span class ="plaincharacterwrap break" >example</span></li>
            
                </ol>
            
        <a href="/recipe/easy-mac-n-cheese/kitchenview.aspx" >Kitchen-Friendly View</a>
    </div>
    <div id="divRecipeTimesContainer"  class ="right-aside preptime fl-right" >
        <ul id="ulReadyTime" >
            <li id="liPrep" >
                PREP
                
                
                <span id="prepMinsSpan" ><em>2</em> mins</span>
                <time id="timePrep"  itemprop="prepTime"  datetime="PT2M" ></time>
            </li>
            <li id="liCook" >
                COOK
                
                
                <span id="cookMinsSpan" ><em>13</em> mins</span>
                <time id="timeCook"  itemprop="cookTime"  datetime="PT13M" ></time>
            </li>
            <li id="liTotal"  class ="no-border" >
                READY IN
                
                
                <span id="totalMinsSpan" ><em class ="emp-orange" >15</em> mins</span>
                <time id="timeTotal"  itemprop="totalTime"  datetime="PT15M" ></time>
            </li>
        </ul>
    </div>
    <div class ="clearfix ie7break" ></div>
</div>
I have the position of the 
<div class ="directions" >, but how can I get the HTML in it? There maybe more elements, if I try to 
code.find("</div>" ); I may return the closing tag of a child of the div 
directions... A sample output I want of the previous input is:
<h3>Directions</h3>
    <div class="directLeft" itemprop="recipeInstructions">
        <div id="msgDirections" style="display:none"></div>
            
                <ol>
            
                <li><span class="plaincharacterwrap break">example</span></li>
            
                </ol>
            
        <a href="/recipe/easy-mac-n-cheese/kitchenview.aspx">Kitchen-Friendly View</a>
    </div>
    <div id="divRecipeTimesContainer" class="right-aside preptime fl-right">
        <ul id="ulReadyTime">
            <li id="liPrep">
                PREP
                
                
                <span id="prepMinsSpan"><em>2</em> mins</span>
                <time id="timePrep" itemprop="prepTime" datetime="PT2M"></time>
            </li>
            <li id="liCook">
                COOK
                
                
                <span id="cookMinsSpan"><em>13</em> mins</span>
                <time id="timeCook" itemprop="cookTime" datetime="PT13M"></time>
            </li>
            <li id="liTotal" class="no-border">
                READY IN
                
                
                <span id="totalMinsSpan"><em class="emp-orange">15</em> mins</span>
                <time id="timeTotal" itemprop="totalTime" datetime="PT15M"></time>
            </li>
        </ul>
    </div>
    <div class="clearfix ie7break"></div>
 
 
Jun 10, 2014 at 1:21pm UTC  
A similar problem. You've got a sequence of opening and closing parenthesis and want to find the matches()(( ()(()())) ()())
 
Jun 10, 2014 at 1:24pm UTC  
@ne555 Ahhh... How dumb of me to miss that! And you've got me thinking!
 
Topic archived. No new replies allowed.