mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-15 20:02:56 +02:00
16
README.md
16
README.md
@@ -18,15 +18,15 @@ Once the page gets loaded, we iterate over all elements in search results and as
|
|||||||
The final for loop filters out empty elements that might be because of inaccurate use of selectors.
|
The final for loop filters out empty elements that might be because of inaccurate use of selectors.
|
||||||
|
|
||||||
```aql
|
```aql
|
||||||
LET g = DOCUMENT("https://www.google.com/", true)
|
LET google = DOCUMENT("https://www.google.com/", true)
|
||||||
|
|
||||||
INPUT(g, 'input[name="q"]', "ferret")
|
INPUT(google, 'input[name="q"]', "ferret")
|
||||||
CLICK(g, 'input[name="btnK"]')
|
CLICK(google, 'input[name="btnK"]')
|
||||||
|
|
||||||
WAIT_NAVIGATION(g)
|
WAIT_NAVIGATION(google)
|
||||||
|
|
||||||
LET result = (
|
LET result = (
|
||||||
FOR result IN ELEMENTS(g, '.g')
|
FOR result IN ELEMENTS(google, '.g')
|
||||||
RETURN {
|
RETURN {
|
||||||
title: ELEMENT(result, 'h3 > a'),
|
title: ELEMENT(result, 'h3 > a'),
|
||||||
description: ELEMENT(result, '.st'),
|
description: ELEMENT(result, '.st'),
|
||||||
@@ -35,9 +35,9 @@ LET result = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
RETURN (
|
RETURN (
|
||||||
FOR i IN result
|
FOR page IN result
|
||||||
FILTER i.title != NONE
|
FILTER page.title != NONE
|
||||||
RETURN i
|
RETURN page
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user