# Script to obtain dom

**URL:** <https://www.ruby-forum.com/t/script-to-obtain-dom/150562>\
**Category:** Rails\
**Created:** [October 9, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/script-to-obtain-dom/150562 "2008-10-09T22:16:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pipex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pipex](https://www.ruby-forum.com/u/pipex)\
**Post date:** [October 9, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/script-to-obtain-dom/150562/1 "2008-10-09T22:16:08Z")

</div>

I need some help, i want to make a script that extracts the DOM objects  
from  
a web page, to get some content.

For example

i have a url  
[www.example.com](http://www.example.com)

 This evening three persons went to visit....

I need to get the content inside that div

–  
Felipe V. Contesse  
IngenierÃ­a Civil Industrial UC

---

<div class="post-metadata">

**Author:** ![pipex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pipex](https://www.ruby-forum.com/u/pipex)\
**Post date:** [October 10, 2008, 3:28am UTC](https://www.ruby-forum.com/t/script-to-obtain-dom/150562/2 "2008-10-10T03:28:44Z")

</div>

On Oct 10, 4:15 am, “Felipe V.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to get the content inside that div
> 
> –  
> Felipe V. Contesse  
> Ingeniería Civil Industrial UC

Take a look at Hpricot.

[http://code.whytheluckystiff.net/hpricot/](http://code.whytheluckystiff.net/hpricot/)

---

<div class="post-metadata">

**Author:** ![pipex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pipex](https://www.ruby-forum.com/u/pipex)\
**Post date:** [October 10, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/script-to-obtain-dom/150562/3 "2008-10-10T17:37:29Z")

</div>

thank you very much it works very good!!!

On Thu, Oct 9, 2008 at 9:27 PM, Erol F.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > 
> 
> Take a look at Hpricot.
> 
> [http://code.whytheluckystiff.net/hpricot/](http://code.whytheluckystiff.net/hpricot/)
> 
> >

–  
Felipe V. Contesse  
IngenierÃ­a Civil Industrial UC
