1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/examples/input.fql

21 lines
588 B
Plaintext
Raw Normal View History

2019-08-22 23:54:52 +02:00
LET google = DOCUMENT("https://www.google.com/", {
driver: "cdp",
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36"
})
2019-08-23 00:07:08 +02:00
HOVER(google, 'input[name="q"]')
WAIT(RAND(100))
INPUT(google, 'input[name="q"]', @criteria, 30)
WAIT(RAND(100))
WAIT_ELEMENT(google, '.UUbT9')
WAIT(RAND(100))
2018-10-09 05:28:15 +02:00
CLICK(google, 'input[name="btnK"]')
2018-10-09 05:28:15 +02:00
WAIT_NAVIGATION(google)
2018-10-09 05:28:15 +02:00
FOR result IN ELEMENTS(google, '.g')
// filter out extra elements like videos and 'People also ask'
FILTER TRIM(result.attributes.class) == 'g'