mirror of
https://github.com/MontFerret/ferret.git
synced 2025-02-09 13:38:35 +02:00
Added example of pagintion using while loop
This commit is contained in:
parent
bd07b84736
commit
6223bbe2d9
12
examples/pagination_while.fql
Normal file
12
examples/pagination_while.fql
Normal file
@ -0,0 +1,12 @@
|
||||
LET doc = DOCUMENT("https://github.com/marketplace/category/api-management", { driver: "cdp"})
|
||||
LET nextSelector = ".paginate-container .BtnGroup a:nth-child(2)"
|
||||
LET elementsSelector = '[data-hydro-click]'
|
||||
|
||||
WAIT_ELEMENT(doc, elementsSelector)
|
||||
|
||||
FOR i DO WHILE ELEMENT_EXISTS(doc, nextSelector)
|
||||
LET wait = i > 0 ? CLICK(doc, nextSelector) : false
|
||||
LET nav = wait ? WAIT(2000) && WAIT_ELEMENT(doc, elementsSelector) : false
|
||||
|
||||
FOR el IN ELEMENTS(doc, elementsSelector)
|
||||
RETURN el
|
Loading…
x
Reference in New Issue
Block a user