Hi othewise i have another chance so that i can change html form what u told
Hi this one i have an html <see><span>Central Kolkat</span><li> <b>Eden Gardens</b> (one of the most famous cricket stadiums in the world), </li><li> <b>Akashwani Bhavan</b>, All India Radio building </li><li> <b>Indoor Stadium</b> </li><li> <b>Fort William</b>, the massive and impregnable British Citadel built in 1773. The fort is still in use and retains its well-guarded grandeur. Visitors are allowed in with special permission only. </li><li> <b>Victoria Memorial</b> <a href=" http://www.victoriamemorial-cal.org" class="external autonumber" title=" http://www.victoriamemorial-cal.org">[10]</a> Along St. George’s Gate Road, on the southern fringe of the Maidan, you will find Kolkata's most famous landmark , a splendid white marble monument (CLOSED MONDAYS). </li><li> <b>Calcutta Racecourse</b> </li><li> <b>Chowringee</b>, is the Market place of Kolkata. You will find shops ranging from Computer Periferals to cloth merchants. Even tailors and a few famous Movie theaters too. This place is a favourite pass time for local people. </li> <span>Red Fort</span><li> <b>Eden Gardens</b> (one of the most famous cricket stadiums in the world), </li><li> <b>Akashwani Bhavan</b>, All India Radio building </li><li> <b>Indoor Stadium</b> </li></see> i WANT TO ADD new element ex: <div> </div> in this html <see><div><span>Central Kolkat</span><li> <b>Eden Gardens</b> (one of the most famous cricket stadiums in the world), </li><li> <b>Akashwani Bhavan</b>, All India Radio building </li><li> <b>Indoor Stadium</b> </li><li> <b>Fort William</b>, the massive and impregnable British Citadel built in 1773. The fort is still in use and retains its well-guarded grandeur. Visitors are allowed in with special permission only. </li><li> <b>Victoria Memorial</b> <a href=" http://www.victoriamemorial-cal.org" class="external autonumber" title=" http://www.victoriamemorial-cal.org">[10]</a> Along St. George’s Gate Road, on the southern fringe of the Maidan, you will find Kolkata's most famous landmark , a splendid white marble monument (CLOSED MONDAYS). </li><li> <b>Calcutta Racecourse</b> </li><li> <b>Chowringee</b>, is the Market place of Kolkata. You will find shops ranging from Computer Periferals to cloth merchants. Even tailors and a few famous Movie theaters too. This place is a favourite pass time for local people. </li></div><div> <span>Red Fort</span><li> <b>Eden Gardens</b> (one of the most famous cricket stadiums in the world), </li><li> <b>Akashwani Bhavan</b>, All India Radio building </li><li> <b>Indoor Stadium</b> </li></div></see> Please note that <div> have to insert before <span> closes when another span tag starts is it possible can anybody help me using hprciot. Regards Prashanth On Wed, Sep 9, 2009 at 9:21 AM, prashanth hiremath < [email protected]> wrote: > Ya I am scraping someone html so that i cant change the format right. > can u help me . > > > > Regards > Prashant > > > > On Tue, Sep 8, 2009 at 10:40 PM, Ar Chron < > [email protected]> wrote: > >> >> Is this your html, or are you scraping someone else's html? >> >> If it's yours, organize your html differently... if you know you want to >> be processing a section at a time, wrap those sections with an >> identifiable container, then scope your searches by the container. >> >> <div> >> <h3>blah</h3> >> <li>a</li> >> <li>b</li> >> </div> >> <div> >> <h3>blah2</h3> >> <li>c</li> >> <li>d</li> >> </div> >> >> (doc/"div").each do |dv| >> this_h3 = (dv/"h3") >> if this_h3.inner_html == "blah2" >> (dv/"li").each do |li| >> puts li.inner_html >> end >> end >> end >> >> emits just c, and d >> >> If its someone else's html in that format, you'll probably have to go >> elem by elem for the whole doc with state machine-ish code to track what >> you've seen previously since there doesn't seem to be any real 'path' to >> the li's per h3. >> -- >> Posted via http://www.ruby-forum.com/. >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

