etaoin

nenadalm 2018-08-06T05:13:34.000151Z

Hi. Here is function from one of my tests if it helps. It returns seqence of rows.

(defn table-data [driver]
  (let [row-els (partition (count (query-all driver "//thead/tr[1]/th"))
                           (query-all driver "//tbody/tr/td"))
        rows (map (fn [row]
                    (map #(get-element-text-el driver %) row))
                  row-els)
        header (map #(get-element-text-el driver %)
                    (query-all driver "//thead/tr/th"))]
    (->> (conj rows header)
         ;; remove action col
         (map butlast))))

1👍1❤️
jdt 2018-08-06T14:32:31.000229Z

There may be super-duper ways to do this using get-element-text or other etaoin functions, unfortunately I don't have a ready response in that regard. For me, particularly parsing external web content of questionable validitiy or content, I usually call api/get-source and parse out all the content I care about with java regular expressions.

jdt 2018-08-06T14:33:56.000390Z

you'll want to make sure you use the (?s) regexp prefix to span newlines 🙂