# Page Scrapping with sessions

**URL:** <https://www.ruby-forum.com/t/page-scrapping-with-sessions/128867>\
**Category:** Ruby\
**Created:** [February 12, 2008, 9:35am UTC](https://www.ruby-forum.com/t/page-scrapping-with-sessions/128867 "2008-02-12T09:35:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepanshu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deepanshu](https://www.ruby-forum.com/u/deepanshu)\
**Post date:** [February 12, 2008, 9:35am UTC](https://www.ruby-forum.com/t/page-scrapping-with-sessions/128867/1 "2008-02-12T09:35:53Z")

</div>

Hi Members of Ruby Group  
I have recently entered the beautiful world of Ruby and it is really  
wonderful language to learn (still learning though)

I need some help on a topic as to how can i screen scrap a web page  
which requires authentication(login name and password ) . After that  
the page is forwarded to a new aspx page for which the screen scraping  
is to be done.  
How to maintain sessions on the same request and how to set cookies if  
any exists for the page. I tried finding answers on the group but i  
found a very old thread which also looked in the problem but not  
taking WEB2.0 perspective the thread link is

[http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/d66e1d2c1cb7d9e4/f8a84cc942ca4f97?lnk=gst&q=screen+scraping+after+login+page+#f8a84cc942ca4f97](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/d66e1d2c1cb7d9e4/f8a84cc942ca4f97?lnk=gst&q=screen+scraping+after+login+page+#f8a84cc942ca4f97)

Any help in the regard will be beneficial

Thanks

---

<div class="post-metadata">

**Author:** ![deepanshu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deepanshu](https://www.ruby-forum.com/u/deepanshu)\
**Post date:** [February 12, 2008, 1:04pm UTC](https://www.ruby-forum.com/t/page-scrapping-with-sessions/128867/2 "2008-02-12T13:04:43Z")

</div>

Deepanshu wrote:

> Hi Members of Ruby Group  
> I have recently entered the beautiful world of Ruby and it is really  
> wonderful language to learn (still learning though)
> 
> I need some help on a topic as to how can i screen scrap a web page  
> which requires authentication(login name and password ) . After that  
> the page is forwarded to a new aspx page for which the screen scraping  
> is to be done.  
> How to maintain sessions on the same request and how to set cookies if  
> any exists for the page.

> Thanks

Mechanize does it automatically for you.
