allow users to pass spider arguments via url
See original GitHub issueWhen running Scrapy from command line you can do:
> scrapy crawl foo_spider -a zipcode=10001
but this is NOT possible with ScrapyRT now. You cannot pass arguments for spiders, you can only pass arguments for request. Adding support for “command_line” arguments is not difficult to implement and seems important IMO.
You could simply pass
localhost:8050/crawl.json?spider=foo.spider&zipcode=10001&url=some_url
EDIT: clarify we’re talking about passing arguments to API via url
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (6 by maintainers)
Top Results From Across the Web
How to pass a user defined argument in scrapy spider
Spider arguments are passed in the crawl command using the -a option. For example: scrapy crawl myspider -a category=electronics -a domain= ...
Read more >Spiders — Scrapy 2.7.1 documentation
Spiders are classes which define how a certain site (or a group of sites) will be scraped, including how to perform the crawl...
Read more >Spider Arguments with Scrapy & Python - YouTube
Scrapy lets us pass in arguments very easily when running our spiders. One use for this is to change categories or certain parameters...
Read more >Using parameters in a URL - Amazon QuickSight
To pass values from one dashboard (or analysis) to another dashboard based on the user's data point selection, use custom URL actions.
Read more >Spring cleaning: the URL Parameters tool - Google Developers
There's no action required from the current users of the tool. Screenshot of the URL parameter tool at its launch The URL Parameters...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have tested the pull request and it is working well, I think should be merged.
@pianista215 : Yeah, i know i will to try @gdelfresno trick and working but i thought pass arguments to meta data is the same. if you pass arguments by
curl -XPOST -d '{ "spider_name":"XXX", "start_requests":true, "request":{ "meta": {"lookup_until_date": "23-09-2017" } } }' "http://localhost:9081/crawl.json" >> response
you can get loockup_until_date byresponse.meta["lookup_until_date"]
😄. Yeah, i have seen you made with change in your repositories, i will to try it. 👍