# Regexp html scraping

**URL:** <https://www.ruby-forum.com/t/regexp-html-scraping/163195>\
**Category:** Ruby\
**Created:** [March 18, 2009, 6:56am UTC](https://www.ruby-forum.com/t/regexp-html-scraping/163195 "2009-03-18T06:56:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunvoip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@arunvoip](https://www.ruby-forum.com/u/arunvoip)\
**Post date:** [March 18, 2009, 6:56am UTC](https://www.ruby-forum.com/t/regexp-html-scraping/163195/1 "2009-03-18T06:56:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arunvoip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@arunvoip](https://www.ruby-forum.com/u/arunvoip)\
**Post date:** [March 18, 2009, 10:41am UTC](https://www.ruby-forum.com/t/regexp-html-scraping/163195/2 "2009-03-18T10:41:08Z")

</div>

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](http://www.google.com)”) do |http|  
resp = http.get(“/”)  
puts resp.body[0…100]  
end

–output:–

Google

---

<div class="post-metadata">

**Author:** ![arunvoip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@arunvoip](https://www.ruby-forum.com/u/arunvoip)\
**Post date:** [March 18, 2009, 11:13am UTC](https://www.ruby-forum.com/t/regexp-html-scraping/163195/3 "2009-03-18T11:13:10Z")

</div>

2009/3/18 Arun K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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
