From 2be3df79c4023bd012e7784a49421d39f17f71dd Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Wed, 4 Mar 2020 13:51:30 -0800 Subject: [PATCH] Delete AdSense element from screenshot. --- src/main/lemondronor/circlebot/adsbx.cljs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/lemondronor/circlebot/adsbx.cljs b/src/main/lemondronor/circlebot/adsbx.cljs index fa5ac96..fd6aab8 100644 --- a/src/main/lemondronor/circlebot/adsbx.cljs +++ b/src/main/lemondronor/circlebot/adsbx.cljs @@ -40,6 +40,15 @@ (/ (.getTime (js/Date.)) 1000)) +(defn delete-node [page selector] + (.evaluate + page + (fn [selector] + (let [node (.querySelector js/document selector)] + (.removeChild (.-parentNode node) node))) + selector)) + + (defn screenshot-aircraft ([icao lat lon] (screenshot-aircraft icao lat lon {})) @@ -70,6 +79,7 @@ url (clj->js {:referer "https://adsbexchange.com/"}))])) (timeout 3000) + (delete-node page "#adsense") (p/all [(.type (.-keyboard page) "l") (timeout 1000)]) (let [path (get options :output-path (str "screenshot-"