regexp html scraping

A

Arun Kumar

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 Kumar
 
7

7stud --

Arun said:
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:--
<html><head><meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1"><title>Google</ti
 
R

Robert Klemme

2009/3/18 Arun Kumar said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top