I am starting to get into python and yes, I have searched this site and the web for an answer, but somehow I really can't get it to run.
I've created a spiderclass EbaySpider, residing in spider/ebay.py that I can start from the command line without problems (even with output to a JSON file). Now I want to start scrapy from within another .py file, so I can directly access the crawled data and output it to a GUI (will think about how to do that later).
I have taken the code from this question (the askers code, as I don't need to run the spider multiple times) and added
from spiders import ebay
from scrapy.crawler import CrawlerProcess
to the beginning, to have all the necessary resources at hand.
The error I get is
ImportError: cannot import name ebay.
Naturally I have played around with the importstatement, changing it from 'ebay' to 'EbaySpider', changing 'spiders' to 'spiders.ebay' or 'projectname.spiders.ebay' but somehow none of them seem to work.
It would be great if you could tell me how to fix this problem, or another way to run the spider and then have access to the crawled data within my python program. I'm happy with anything that works and is halfway understandable :)
Thanks people!