i am working on a scraper that saves results to a json like this:
{"Productos" : [
{"Title":"Grabador de voz ISD1932","Results": [
{"Stock":1,"Price":11.4,"Fecha":"18-8-2014:3:36"},
{"Stock":1,"Price":12.4,"Fecha":"18-8-2014:3:38"},
{"Stock":1,"Price":12.4,"Fecha":"19-8-2014:0:40"},
{"Stock":1,"Price":12.4,"Fecha":"19-8-2014:21:46"},
{"Stock":1,"Price":12.4,"Fecha":"21-8-2014:22:4"},
{"Stock":1,"Price":12.4,"Fecha":"22-8-2014:0:40"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:0:48"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"},
{"Stock":1,"Price":12.4,"Fecha":"23-8-2014:13:56"}],
"id":"4a1e90d7-e578-4bd5-b888-38c7bbfb4af5"}]}
So first element in results would be:
{"Stock":1,"Price":11.4,"Fecha":"18-8-2014:3:36"}
second would be
{"Stock":1,"Price":12.4,"Fecha":"18-8-2014:3:38"}
third would be
{"Stock":1,"Price":12.4,"Fecha":"19-8-2014:0:40"} and so.
Every time i scrape the web, it adds an element.
I would like to do a cleaner that removes an element if stock and price equals the previous one, but only the previous one, excluding the date.
On this example, as third element equals the second, i'd like to remove it. If 4rth equals the 3rd, then remove it, and so on.