# Cookies and sessions

**URL:** <https://www.ruby-forum.com/t/cookies-and-sessions/114921>\
**Category:** Ruby\
**Created:** [September 18, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/cookies-and-sessions/114921 "2007-09-18T20:36:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarvo88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a8b319/32.png) [@jarvo88](https://www.ruby-forum.com/u/jarvo88)\
**Post date:** [September 18, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/cookies-and-sessions/114921/1 "2007-09-18T20:36:08Z")

</div>

Ok guys, I need to build a script that connects to a websites, grabs and  
opens a link, parses the contents in that link and submit the findings  
in a form, I have most of it done, But the link for the file i need to  
parse is random and changes on every session so i always get an error  
when i am trying to open it… It looks something like this:

site = Net::HTTP.post\_form(url,  
{‘start’ =\> ‘1’})  
link = site.body.scan(/href="(.+?)"\>/)  
open(link) # it fails here, because its not the same session

Any ideas? Sorry if i didn’t explain myself very well

tia

---

<div class="post-metadata">

**Author:** ![jarvo88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a8b319/32.png) [@jarvo88](https://www.ruby-forum.com/u/jarvo88)\
**Post date:** [September 18, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/cookies-and-sessions/114921/2 "2007-09-18T22:04:50Z")

</div>

Lee J. wrote:

> Any ideas? Sorry if i didn’t explain myself very well
> 
> tia  
> use google?  
> there’s bunch of frameworks for web-scraping with ruby, why nbot use  
> them, to save you searching try www::mechanize or scrubyt

---

<div class="post-metadata">

**Author:** ![jarvo88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a8b319/32.png) [@jarvo88](https://www.ruby-forum.com/u/jarvo88)\
**Post date:** [September 19, 2007, 12:32am UTC](https://www.ruby-forum.com/t/cookies-and-sessions/114921/3 "2007-09-19T00:32:54Z")

</div>

Marcin R. wrote:

> Lee J. wrote:
> 
> > Any ideas? Sorry if i didn’t explain myself very well
> > 
> > tia  
> > use google?  
> > there’s bunch of frameworks for web-scraping with ruby, why nbot use  
> > them, to save you searching try www::mechanize or scrubyt

Yeah i did use google, not really sure how to use it to be honest, I  
should try harder before posting 😛

thanks anyway
