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

add "flags" kwarg to Scrapy Request #2047

Closed
pawelmhm opened this issue Jun 10, 2016 · 1 comment
Closed

add "flags" kwarg to Scrapy Request #2047

pawelmhm opened this issue Jun 10, 2016 · 1 comment

Comments

@pawelmhm
Copy link
Contributor

@pawelmhm pawelmhm commented Jun 10, 2016

Scrapy response.flags are really useful and underappreciated feature. It would be useful to add a way to pass flags argument to Request at initialization, e.g.

def some_callback(self, response):
      yield Request('http://example.com', flags={"issued from": "some_callback", "going to": "somewhere")

and then in log output you will have:

[scrapy.core.engine] Crawled (200) <GET http://example.com>  ['issued_from": "some_callback', "going to": "somewhere"]

This is useful because it allows you to have some heplful debugging metadata directly in logs. If you want to debug some spider problem you will have some metadata directly in logs and you dont have to start debugger in some callback and investigate response meta or some other stuff.

@pawelmhm pawelmhm changed the title add extra flags kwarg to Request class add "flags" kwarg to Scrapy Request Jun 10, 2016
@kmike
Copy link
Member

@kmike kmike commented Feb 22, 2017

Fixed by #2082, though flags is a list, like in responses.

@kmike kmike closed this Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.