blah blah blah is here! blah blah » Close

up0down
link

Hi,
If I am scraping a webpage, if the page has cookies, how can I detect cookies and store them in some kind of collection, as I might need those cookies for further requests? (say like if I have to do authentication during the page scrape and have to pass in the authentication cookie during my subsequent page scrapes).

last answered 2 years ago

1 answers

up0down
link

sorry i'm a bit drunk but is there a lawful application for such a function? sounds like you want to spoof, phish or something...
cookies are transmitted to the server with every page request. the server uses them to prepare its next page for sending. some cookies exist only in browser memory whilst others are written to client cookie files.
the client browser display routine is ignorant of cookies.

up0down
link

Sure there is, if I want to spider information.
Say I want to build a application that logs into my hotmail account.
I need to post my username and password into the form, then Hotmail is probably going to issue me some cookies that tell the browser i'm already logged in.
I need to pass those cookies on subsequent requests so I can fetch my email.
Am I right?

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback