Hi

I'm trying to use Toke::Parse and would appreciate some advice.

My html is something like this

<div id="mainbody">
  <h1>advise you to</h1>
  <ul>
    
      <li>
            <a href="/Advice/apples">apples</a> 
      </li>

      <li>
            <a href="/Advice/oranges">oranges</a> 
      </li>
      <li>
            <a href="/Advice/pears">pears</a> 
      </li>

  </ul>
    <div id="footer">  
          <p class="style1"><span class="siteName">Smartshopper</span> is 
provided by the <a href="http://www.fat.gov";>FatTrade</a>.</p>
          <p><span class="style3 noprint">

            <a href="http://fat.gov/copyright.html";>Copyright</a> 
            <a href="http://www.fat.gov/disclaim.html";>Disclaimer</a> 
            <a href="http://www.fat.gov/privacy.html";>Privacy</a>
        </span>
          </p>
    </div>
</div>

my toke paser snippet

while ( $tag = $stream->get_tag("div") ) {
    if ($tag->[1]{id} and $tag->[1]{id} eq 'mainbody') {
        while ($tag = $stream->get_tag('a')){
            print Dumper $tag;
        }
    }
}

my problem

How do I stop the parser when I reach "pears".

Thanks for the assist

CCJ




      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at 
Yahoo! http://uk.docs.yahoo.com/ymail/new.html

Reply via email to