Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Instance of scrapy.Request #1987

Closed
gdomod opened this issue May 12, 2016 · 2 comments
Closed

New Instance of scrapy.Request #1987

gdomod opened this issue May 12, 2016 · 2 comments

Comments

@gdomod
Copy link

gdomod commented May 12, 2016

Hi there,

i want to scraps a board with different users.

i create a subclass from Request but
class Test(scrapy.Request): def __init__(self, *args, **kwargs): super(Test, self).__init__(*args, **kwargs)

But i didnt get new instance from Request Object, so there i always got same cookies etc.

Can anybody help me please

@redapple
Copy link
Contributor

@gdomod , by default, CookieMiddleware will share the same session for all requests.

If you want to emulate parallel (cookie) sessions, check the cookiejar key in meta dict that you can pass to Request instances.

Note the comment on passing the cookiejar key explicitly in subsequent requests:

Keep in mind that the cookiejar meta key is not “sticky”. You need to keep passing it along on subsequent requests.

@kmike
Copy link
Member

kmike commented May 16, 2016

I agree that cookies API can be confusing; it can be improved. If you have ideas feel free to weight in at #1878.

But this feature works as intended, so I'm closing this ticket.

@kmike kmike closed this as completed May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants