Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to except Error when spider raise Errors. #10

Open
wsgggws opened this issue May 21, 2018 · 0 comments
Open

How to except Error when spider raise Errors. #10

wsgggws opened this issue May 21, 2018 · 0 comments

Comments

@wsgggws
Copy link

wsgggws commented May 21, 2018

I use code:

try:
    result = scrapydo.run_spider(MySpider, **kwargs)
except Exception:
    result = None

ERROR:scrapy.core.scraper:Spider error processing <POST http://www.example.com> (referer: None)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/scrapy/utils/defer.py", line 102, in iter_errback
yield next(it)
File "/usr/local/lib/python3.6/site-packages/scrapy/spidermiddlewares/offsite.py", line 30, in process_spider_output
for x in result:
File "/usr/local/lib/python3.6/site-packages/scrapy/spidermiddlewares/referer.py", line 339, in
return (_set_referer(r) for r in result or ())
File "/usr/local/lib/python3.6/site-packages/scrapy/spidermiddlewares/urllength.py", line 37, in
return (r for r in result or () if _filter(r))
File "/usr/local/lib/python3.6/site-packages/scrapy/spidermiddlewares/depth.py", line 58, in
return (r for r in result or () if _filter(r))
File "/Users/hjtian/github/courier-spiders/crawler/crawler/spiders/aftership_spider.py", line 62, in parse
raise TypeError
TypeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant