Doubt in yeast keyword

When a yield keyword is used inside a function, a function becomes a generator. I need some more clarity for the usage of the yield keyword. We have used it in the response method of our spider class. It yields text, author, and tags in the form of a dictionary. Can you explain how?

hey @Mohit2000 ,

This is your choice in what way you want to generate that data, may it be list or dict or anything else.
It solely depends upon you.

And about explaining , can you please more brief about what do you actually want to understand.
Thank You :slightly_smiling_face:.

I just want to know what is going on behind when we yield a response.

Its nothing as such , it is just called in a loop and on each iteration it yields some data that is getting stored or being in real time written in the file stated in the code.

Hence in the end you get that data.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.