From: Todd Benson Date: 2008-02-28T21:07:52+09:00 Subject: Re: Need a regex searching html code On Thu, Feb 28, 2008 at 12:40 AM, Chirantan wrote: > I have an html code into string. I want to retrieve the content (Can > be any HTML code with any number of tags) present inside the div after > the heading till the end of the div. > > Example, > >
>
Tagline:
> Yippee Ki Yay Mo - John 6:27 >
> >
>
Plot Outline:
> John McClane takes on an Internet-based terrorist organization who is > systematically shutting down the United States. onclick="(new Image()).src='/rg/title-tease/plotsummary/images/b.gif? > link=/title/tt0337978/plotsummary';">more >
> > > In the above example, Plot Outline is header that I am looking for > then, regex should give me - > > John McClane takes on an Internet-based terrorist organization who is > systematically shutting down the United States. onclick="(new Image()).src='/rg/title-tease/plotsummary/images/b.gif? > link=/title/tt0337978/plotsummary';">more > > > And if "Tagline:" is what I am looking for then regex should give me - > > Yippee Ki Yay Mo - John 6:27 > > I hope the problem statement is clear. Scraping html is not the easiest thing in the world. I would recommend the hpricot library. Todd