Regexp html scraping

Hi,
I’ve to extract the full html from a website url using regular
expressions or ‘net-http’. Can anybody help me with the code to extract
the full html content of a website. I need to use only regexp or
‘net:http’

Thanks
Arun K.

Arun K. wrote:

Hi,
I’ve to extract the full html from a website url using regular
expressions or ‘net-http’. Can anybody help me with the code to extract
the full html content of a website. I need to use only regexp or
‘net:http’

require ‘net/http’

Net::HTTP.start(“www.google.com”) do |http|
resp = http.get("/")
puts resp.body[0…100]
end

–output:–

Google</ti

2009/3/18 Arun K. [email protected]:

I’ve to extract the full html from a website url using regular
expressions or ‘net-http’.

What kind of question is that? Use net-http OR regular expressions -
I mean, both serve totally different purposes. You cannot exchange
one for the other. You’ll have difficulties to obtain the content
using regular expressions only…

Wondering…

robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs