Comments (5)
schedule.json is correct. __init__
func needs change like this could solve my problem.
def __init__(self, mgo_db=None, mgo_table=None, *args, **kwargs):
mgo_conn = get_mgo_client()
self.mgo_table = mgo_conn[mgo_db][mgo_table]
super(MtopSpider, self).__init__()
init take any spider arguments and copy them to spider as attrbutes
thank you very much 👍 hhhhhhh~~
from scrapydweb.
It should work if you add '-d symbol=APPL' in the additional text box!
from scrapydweb.
Thank you, this worked 🎉
from scrapydweb.
i want pass params to spider , so i use init func to get -a params like this
def __init__(self, mgo_db, mgo_table):
mgo_conn = get_mgo_client()
self.mgo_table = mgo_conn[mgo_db][mgo_table]
super(MtopSpider, self).__init__()
and add
'-d mgo_db=mtop
-d mgo_table=taolijin'
in the additional text box
but i got
2019-03-20 21:33:09 [twisted] CRITICAL:
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/scrapyd-server-b9lo-2yl/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
result = g.send(result)
File "/root/.local/share/virtualenvs/scrapyd-server-b9lo-2yl/lib/python3.7/site-packages/scrapy/crawler.py", line 79, in crawl
self.spider = self._create_spider(*args, **kwargs)
File "/root/.local/share/virtualenvs/scrapyd-server-b9lo-2yl/lib/python3.7/site-packages/scrapy/crawler.py", line 102, in _create_spider
return self.spidercls.from_crawler(self, *args, **kwargs)
File "/root/.local/share/virtualenvs/scrapyd-server-b9lo-2yl/lib/python3.7/site-packages/scrapy_redis/spiders.py", line 153, in from_crawler
obj = super(RedisSpider, self).from_crawler(crawler, *args, **kwargs)
File "/root/.local/share/virtualenvs/scrapyd-server-b9lo-2yl/lib/python3.7/site-packages/scrapy/spiders/__init__.py", line 51, in from_crawler
spider = cls(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument '_version'
what shoud i do for this? thanks a lot :)
from scrapydweb.
Check out https://doc.scrapy.org/en/latest/topics/spiders.html#spider-arguments
from scrapydweb.
Related Issues (20)
- Not able to see stats section of the job HOT 1
- scrapydweb failed to run on python 3.8 HOT 5
- 启动报错:sqlite3.OperationalError: no such table: metadata HOT 13
- Is it possible to run multiple spider at the same time in a tmux machine with scrapydweb automatically
- items Oops! Something went wrong. HOT 1
- scrapydweb fresh install won't run HOT 8
- APScheduler 3.10 causing 500 errors HOT 2
- How to Change Timezone of scrapydweb? HOT 3
- Which scrapyd image you use? HOT 2
- Clean install on clean Ubuntu VM. Whatever I do it is not working. HOT 2
- Docker compose scrapdweb with scrapyd the log url use docker name
- Processes dont stop after finishing HOT 1
- v1.4.1 submit cron job can't run HOT 1
- ('Connection aborted.', timeout('timed out',))
- ERROR: Package 'scrapydweb' requires a different Python: HOT 4
- Error while installing scrapydweb HOT 2
- spiders are closed but showing as running/warning in the tasks page
- web界面可以使用中文吗? HOT 1
- DATABASE_URL配置连接域名:端口的mysql失败 HOT 2
- Jobs are killed without a clear reason HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrapydweb.