diff --git a/README.md b/README.md index eb56839b..c85235b4 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ after a mysteries note was produced on it. * [Vector syntax for querying](#vector-syntax-for-querying) * [Advanced queries](#advanced-queries) + [Querying the *nth* element matched](#querying-the-nth-element-matched) + + [Getting elements like in a tree](getting-elements-like-in-a-tree) * [Interacting with queried elements](#interacting-with-queried-elements) - [Emulation of human input](#emulation-of-human-input) - [Mouse clicks](#mouse-clicks) @@ -203,6 +204,17 @@ The good news you may automate your browser directly from the REPL: (fill driver {:tag :input :name :search} k/enter) (wait-visible driver {:class :mw-search-results}) +;; select an `option` in select-box by visible text +;; +(select driver :country "France") +(get-element-value driver :country) +;;=> "fr" + ;; I'm sure the first link is what I was looking for (click driver [{:class :mw-search-results} {:class :mw-search-result-heading} {:tag :a}]) (wait-visible driver {:id :firstHeading}) diff --git a/src/etaoin/api.clj b/src/etaoin/api.clj index 2174b96a..044f5f81 100644 --- a/src/etaoin/api.clj +++ b/src/etaoin/api.clj @@ -2514,7 +2514,7 @@ - `q`: a query term, see `query` function for more info, - - `text`: a string to input." + - `text`: a string, text in the option you want to select" [driver q text] (let [el (query driver q {:tag :option :fn/has-text text})] (click-el driver el)))