-
Notifications
You must be signed in to change notification settings - Fork 162
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
How to access to meta values? #81
Comments
Do you have been slove the issues? can you tell me the method |
indeed that doesn't work, I'm going to fix it. edit: it only happens when you set start_requests: True and provide request object with meta. In this case meta is not passed to spider. |
I guess this workaround might help you for now.
below first try:except block in prepare_crawl method, so it looks as on attached screenshot
test parameter should be avaiable as self.test I'm not sure, but I think I found this solution in open PR, @pawelmhm maybe it is good idea to merge it? I'm using this patch around half year and it seems to be fine. |
Hi,
I'm doing this request:
curl -XPOST -d '{ "spider_name":"quotes", "start_requests":true, "request":{ "meta": {
"test": "1", } } }' "http://138.219.228.215:9080/crawl.json"
Then I try to access from my spider by print(response.meta) and this is what it shows:
{'depth': 0, 'download_latency': 0.03323054313659668, 'download_slot': 'URL', 'download_timeout': 180.0}
of course response.meta["test"] throws error.
I need to use this "test" parameter to fill the form request
EDIT: spider : https://pastebin.com/EFz818qL
thanks!
The text was updated successfully, but these errors were encountered: