[Autogenerated] all right.
Time for another demo.
What we'll do now is to implement a feed exporter mechanism in
one of our scrapie spiders to export natively.
Any scrape data,
Let's have a look going back to the code from the previous demos.
Let's go into pipelines dot pie and add some logic to
remove expensive books from the results.
Notice that we had already imported drop item.
So here, when the book is considered expensive,
let's raise a call to the drop item class,
which will remove the book from the spider results.
Let's give this a try.
Notice the items dropped count here.
This indicates how many books scraped were removed from the results.
In other words,
these books have a price that is above £50 if we want the
spider to up with the results to a JSON file,
what we need to do is to go into settings dot pie and said feed
format to JSON and also feed you or I two books.
Do JSON Let's run the spider again.
We can see that we still have the same dropped items,
but now we also have books.
Do JSON.
Let's have a look at the contents of books do JSON.
It has all the fields we expect in JSON format.
If we want to see the results using XML,
all we need to do is change these values so we can run the spider again,
notice that we get the same results, but now as XML.
So by doing this,
we are leveraging the power of the scrapie framework to drop items
we don't need and also by writing those results in the format we
need without writing too much logic.