scrape-it icon indicating copy to clipboard operation
scrape-it copied to clipboard

Add support to lt/gt functions

Open alexschwarz89 opened this issue 7 years ago • 2 comments

Scraping multiple values in a list it could be useful to implement the gt (greater than) and lt (lower than) class in addition to the already implemented eq (equals).

alexschwarz89 avatar May 08 '18 08:05 alexschwarz89

Can you detail how would that work (jQuery syntax vs scrape-it syntax you imagine)?

IonicaBizau avatar May 09 '18 07:05 IonicaBizau

My first thoughts were new attributes on the same level as listSelector, possible names could be offset and limit.

So for example, a configuration for scraping the current NGINX versions could look like

                listSelector: "#content table",
                limit: 2,
                data: {
                    version: {
                        eq: 1,
                        selector: "td a"
                    }
                }

because anything above are the legacy versions, i don't want to scrape. Now imagine you dont wan't the first table, and there is no class or id to filter, you could define an offset: 1.

What do you think?

alexschwarz89 avatar May 09 '18 16:05 alexschwarz89

I think this should be part of the post-scraping logic.

IonicaBizau avatar Mar 19 '23 14:03 IonicaBizau