1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-05-27 22:57:54 +02:00

Update input.fql

This commit is contained in:
Tim Voronov 2019-08-22 18:07:08 -04:00 committed by GitHub
parent 0f88408054
commit b855f203e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,14 @@ LET google = DOCUMENT("https://www.google.com/", {
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" 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"
}) })
INPUT(google, 'input[name="q"]', "ferret") 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))
CLICK(google, 'input[name="btnK"]') CLICK(google, 'input[name="btnK"]')
WAIT_NAVIGATION(google) WAIT_NAVIGATION(google)
@ -11,8 +18,3 @@ WAIT_NAVIGATION(google)
FOR result IN ELEMENTS(google, '.g') FOR result IN ELEMENTS(google, '.g')
// filter out extra elements like videos and 'People also ask' // filter out extra elements like videos and 'People also ask'
FILTER TRIM(result.attributes.class) == 'g' FILTER TRIM(result.attributes.class) == 'g'
RETURN {
title: INNER_TEXT(result, 'h3'),
description: INNER_TEXT(result, '.st'),
url: INNER_TEXT(result, 'cite')
}