github.com/MontFerret/ferret@v0.18.0/examples/while.fql (about) 1 LET doc = DOCUMENT("https://github.com/MontFerret/ferret/stargazers", { driver: "cdp" }) 2 3 LET nextSelector = '[data-test-selector="pagination"] .btn:nth-child(2):not([disabled])' 4 LET elementsSelector = '#repos ol li' 5 6 FOR i DO WHILE ELEMENT_EXISTS(doc, nextSelector) 7 LIMIT 3 8 LET wait = i > 0 ? CLICK(doc, nextSelector) : false 9 LET nav = wait ? (WAITFOR EVENT "navigation" IN doc) : false 10 11 FOR el IN ELEMENTS(doc, elementsSelector) 12 FILTER ELEMENT_EXISTS(el, ".octicon-organization") 13 14 RETURN { 15 name: INNER_TEXT(el, 'div > div:nth-child(2) [data-hovercard-type="user"]'), 16 company: INNER_TEXT(el, "div > div:nth-child(2) p") 17 }