This question is all over SO but I'm not entirely sure if this solution even works.
I have a scrapy script that I would like to convert to an .app file. There's a program called Platypus[] that uses a GUI to convert python projects into an application. Ultimately I want to just have something I or someone else can interact with and have the spider start running.
So i was thinking
make a script to run spider -> feed that into platypus -> create program that someone would just have to click on
The argument I normally run through terminal is
scrapy crawl [spiderName] -t csv -o - > "pathName"
After some research I found this might be the most simple way of pulling it off
import os
os.system('scrapy crawl [spiderName] -t csv -o - > "pathName"')
I have this program in the same directory as my spider, but when I run it nothing happens. [Spider does not run]
Another Question: I know I would have to adjust the script to run the spider on someone else's machine for the directory (which is fine) but would I have to install scrapy on the other person's machine as well?
Thanks for any help!
Edit: When trying to use subprocesses, same result where Spider was not ran
subprocess.Popen('scrapy crawl [spiderName] -t csv -o - > "pathName"', shell = True)
Edit #2: The way to do subprocesses is this:
process = subprocess.Popen(['scrapy', 'crawl', 'homeDepotSpider'] , shell=True)
However when I run this I don't this it is being ran in the correct directory even though the runspider program is in the same directory as my spider.
After typing 'ls' into terminal I found out that I'm in the desktop directory
Figured it out, feel dumb for missing this one.
I wasn't in the correct directory (Not sure if this is something only for OSX)
os.chdir(path name of folder)