Skip to content

Commit

Permalink
Update input.fql
Browse files Browse the repository at this point in the history
  • Loading branch information
ziflex authored Aug 22, 2019
1 parent 602dc0d commit 0f88408
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/input.fql
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
LET google = DOCUMENT("https://www.google.com/", { driver: "cdp" })
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"
})

INPUT(google, 'input[name="q"]', "ferret", 25)
INPUT(google, 'input[name="q"]', "ferret")
CLICK(google, 'input[name="btnK"]')

WAIT_NAVIGATION(google)
WAIT_ELEMENT(google, '.g', 5000)

FOR result IN ELEMENTS(google, '.g')
// filter out extra elements like videos and 'People also ask'
Expand All @@ -13,4 +15,4 @@ FOR result IN ELEMENTS(google, '.g')
title: INNER_TEXT(result, 'h3'),
description: INNER_TEXT(result, '.st'),
url: INNER_TEXT(result, 'cite')
}
}

0 comments on commit 0f88408

Please sign in to comment.