1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00
ferret/examples/input.fql
2018-10-05 23:36:23 -04:00

21 lines
423 B
Plaintext

LET g = DOCUMENT("https://www.google.com/", true)
INPUT(g, 'input[name="q"]', "ferret")
CLICK(g, 'input[name="btnK"]')
WAIT_NAVIGATION(g)
LET result = (
FOR result IN ELEMENTS(g, '.g')
RETURN {
title: ELEMENT(result, 'h3 > a'),
description: ELEMENT(result, '.st'),
url: ELEMENT(result, 'cite')
}
)
RETURN (
FOR i IN result
FILTER i.title != NONE
RETURN i
)