Cookies and sessions

L

Lee Jarvis

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
 
M

Marcin Raczkowski

Lee said:
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
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
 
L

Lee Jarvis

Marcin said:
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 :p

thanks anyway
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top