Hi Wei, i think you'll find answer here: http://doc.scrapy.org/en/latest/topics/practices.html#run-scrapy-from-a-script. In a few words, you should use scrapi API to manage created spider from main script.
понедельник, 6 января 2014 г., 18:48:02 UTC+4 пользователь Wei Oui написал: > > Hi Piotr, > > I'm a newbie to python and I need to do a crawler with a simple GUI. I had > done my spider and it work perfectly but I don't know how to incorporate > with a GUI. I read a simple tutorial with wxPython but I have no idea how > to implement it with scrapy. Can you please give a a help (an example)? > > Thanks in advance. > Wei > > On Friday, August 30, 2013 1:12:06 AM UTC+8, Piotr wrote: >> >> Hello >> >> I have a scrapy project with ~30 spiders. It is meant to be a standalone >> windows desktop application so I wrote a simple GUI in wxPython and I run >> them from Python script. >> I tried to package it into an exe file using pyinstaller and py2exe and >> this is where I have issues. >> Exporting ends with a success and no errors, but the executable fails >> whenever there is a pkgutil.get_data() call. >> >> Has anyone succeeded in exporting a scrapy app? >> >> I include tracebacks below >> >> Piotr >> >> >> Running .exe from py2exe: >> >> Traceback (most recent call last): >>> File "wx_gui.py", line 51, in <module> >>> File "scrapy\responsetypes.pyc", line 114, in <module> >>> File "scrapy\responsetypes.pyc", line 35, in __init__ >>> File "pkgutil.pyc", line 591, in get_data >>> IOError: [Errno 3] No such process: 'scrapy\\mime.types' >> >> >> >> Running .exe from pyinstaller (pkgutil.get_data returns None instead of >> mimetypes there): >> >> D:\dev\scrp\release\dist\scrp.exe?175104\twisted\python\modules.py:775: >>> UserWarning: D:\dev\scrp\release\dist\scrp.exe?175104 (for module >>> twisted.web.util) not in path importer cache (PEP 302 violation - check >>> your local configuration). >>> Traceback (most recent call last): >>> File "<string>", line 51, in <module> >>> File "C:\dev\PyInstaller\loader\iu.py", line 386, in importHook >>> mod = _self_doimport(nm, ctx, fqname) >>> File "C:\dev\PyInstaller\loader\iu.py", line 480, in doimport >>> exec co in mod.__dict__ >>> File >>> "release\build\pyi.win32\scrp\out00-PYZ.pyz\scrapy.responsetypes", line >>> 114, in <module> >>> File >>> "release\build\pyi.win32\scrp\out00-PYZ.pyz\scrapy.responsetypes", line 37, >>> in __init__ >>> TypeError: expected read buffer, NoneType found >> >> >> -- You received this message because you are subscribed to the Google Groups "scrapy-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/scrapy-users. For more options, visit https://groups.google.com/d/optout.
