1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-11 01:10:27 +02:00
Files
ferret/docs/examples/input.fql

24 lines
539 B
Plaintext
Raw Normal View History

LET g = DOCUMENT("https://www.google.com/", true)
LET inputBox = ELEMENT(g, 'input[name="q"]')
INPUT(inputBox, "ferrer")
LET searchBtn = ELEMENT(g, 'input[name="btnK"]')
CLICK(searchBtn)
WAIT_NAVIGATION(g)
LET result = ELEMENTS(g, '.g')
LOG(result ? 'element' : 'no element')
RETURN result ? (
FOR result IN ELEMENTS(g, '.g')
LOG('iterate')
RETURN {
title: ELEMENT(result, 'h3 > a'),
description: ELEMENT(result, '.st'),
url: ELEMENT(result, 'cite')
}
) : 'no results'