How to write to file the results? #233
Replies: 2 comments 4 replies
-
Here's my working pipelines: [
Crawly.Pipelines.JSONEncoder,
{Crawly.Pipelines.WriteToFile, extension: "jsonl", folder: "./tmp"}
], Maybe it's my use of |
Beta Was this translation helpful? Give feedback.
-
Oh, duh. You're totally right. I'm honestly not sure about when data is added, but I'm working on the code today and I'll see. My code is open source, btw. You can try it out and see the full configuration. https://github.com/public-law/oregon-revised-statutes-crawler |
Beta Was this translation helpful? Give feedback.
-
Hi Crawly Community!
Thank you a lot for this package that it is really useful. I follow the example given on the README of the repository and it works really fine, but something is wrong when writting to a file but I am not getting any error.
I have the next configuration:
And what I get when I run
iex -S mix run -e "Crawly.Engine.start_spider(CrawlyCabildogc.CabildoNews)"
is:Of course, with more than one result. I think the only warning I am getting is not the problem.
The source code of the spider is practically the same than the one in the example you use on the README, with a few changes to adapt it to my case. I share here what I have on
parse_item/1
:Any idea about why I am not obtaining the results written on a file?
Thank you in advance for your attention.
Regards,
Iván
Edit: according to
Crawly.Pipelines.WriteToFile
docs, if the folder doesn't exist, it is created:I test now using
{Crawly.Pipelines.WriteToFile, extension: "jl", folder: "/tmp/crawly"}
and I checked that the foldercrawly
is not created.Beta Was this translation helpful? Give feedback.
All reactions