First of all, To see the cookies being sent, you have to enable the cookies debug option. You do that by adding the following line to your setting file. COOKIES_DEBUG = True
Second, to pass a cookie value into your request, you need to create the request<http://doc.scrapy.org/en/latest/topics/request-response.html#request-objects>. Then, add the cookies parameter. For example: request_with_cookies = Request(url="Your url", cookies={'code_pays': '2', ' code_region': '0'}) On Friday, January 28, 2011 4:46:14 PM UTC+2, Rosa Luna wrote: > > Hi, > > I'm trying to scrape some data from a site that use cookie for the > language of the site. > > How to pass to my spider this cookie value for language: > > Cookie: code_pays=2; code_region=0; > > In the spider? > > I don't know where to set up the CookiesMiddleware shown here > :http://doc.scrapy.org/topics/downloader-middleware.html<http://www.google.com/url?q=http%3A%2F%2Fdoc.scrapy.org%2Ftopics%2Fdownloader-middleware.html&sa=D&sntz=1&usg=AFQjCNG11cQs3AusuYLUvRU2vSTOTEckuw> > ?? > > Thanks for your help to a new scrapy "lost" user ;-) > > Scrapy is awsome! > > -- You received this message because you are subscribed to the Google Groups "scrapy-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/scrapy-users. For more options, visit https://groups.google.com/d/optout.
