E
E
Evgen2015-01-14 21:56:48
Python
Evgen, 2015-01-14 21:56:48

Scrapy - how to make a function continue after return item?

I'm trying to teach scrapy to work with captcha.
I came to the conclusion that you need to use ImagePipeline, but the problem is that the picture is downloaded to the computer only after the function has fully worked out. Yield doesn't help.
Q:
How do I get scarpy to continue executing a function after yield item?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sakuradaj, 2015-01-16
@sakuradaj

Asked
a similar question on stackoverflow
The point is to use Deferred

E
Evgen, 2016-10-30
@Verz1Lka

Resolved the issue in a slightly different way. Exclusively for captcha.
With another request, I download the captcha, save the answer in jpg. Further in this request, I call the methods for parsing this captcha and send it where necessary.
If anyone is interested, I'll throw off code examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question