From: William James Date: 2008-03-01T13:49:59+09:00 Subject: Re: Scan HTML On Feb 29, 9:22 pm, Tom Arra wrote: > So I am new to Ruby scripting so I am not sure if this is possible or > not. I want to make a script that will load a webpage and then search > through the HTML of that page until it hits a certain tag. Once it hits > that tag it need to grab all of the text between the tag and the > appropriate end tag. Is something like this possible? > > Example > > >

test

> > > > I want the script to return "test" > -- > Posted viahttp://www.ruby-forum.com/. require 'net/http' puts Net::HTTP.new('www.google.com').get('/'). body[ %r{(.*?)}mi, 1 ] If the tag can contain attributes, e.g., : require 'net/http' puts Net::HTTP.new('www.google.com').get('/'). body[ %r{<title(?:\s*|\s+.*?)>(.*?)</title\s*>}mi, 1 ]