1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-02-01 13:07:49 +02:00
ferret/examples/while.fql

18 lines
643 B
Plaintext
Raw Normal View History

2020-11-29 19:26:21 -05:00
LET doc = DOCUMENT("https://github.com/MontFerret/ferret/stargazers", { driver: "cdp" })
LET nextSelector = '[data-test-selector="pagination"] .btn:nth-child(2):not([disabled])'
LET elementsSelector = '#repos ol li'
2020-11-29 19:26:21 -05:00
FOR i DO WHILE ELEMENT_EXISTS(doc, nextSelector)
LIMIT 3
LET wait = i > 0 ? CLICK(doc, nextSelector) : false
LET nav = wait ? (WAITFOR EVENT "navigation" IN doc) : false
2020-11-29 19:26:21 -05:00
FOR el IN ELEMENTS(doc, elementsSelector)
FILTER ELEMENT_EXISTS(el, ".octicon-organization")
2020-11-29 19:26:21 -05:00
RETURN {
name: INNER_TEXT(el, 'div > div:nth-child(2) [data-hovercard-type="user"]'),
company: INNER_TEXT(el, "div > div:nth-child(2) p")
2020-11-29 19:26:21 -05:00
}