question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow users to pass spider arguments via url

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Comments:26 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
alerootcommented, Jan 29, 2018

I have tested the pull request and it is working well, I think should be merged.

2reactions
dotungvp1994commented, Nov 9, 2017

@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 by response.meta["lookup_until_date"] 😄. Yeah, i have seen you made with change in your repositories, i will to try it. 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found