Delete AdSense element from screenshot.
This commit is contained in:
parent
e910eddc4a
commit
2be3df79c4
@ -40,6 +40,15 @@
|
|||||||
(/ (.getTime (js/Date.)) 1000))
|
(/ (.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
|
(defn screenshot-aircraft
|
||||||
([icao lat lon]
|
([icao lat lon]
|
||||||
(screenshot-aircraft icao lat lon {}))
|
(screenshot-aircraft icao lat lon {}))
|
||||||
@ -70,6 +79,7 @@
|
|||||||
url
|
url
|
||||||
(clj->js {:referer "https://adsbexchange.com/"}))]))
|
(clj->js {:referer "https://adsbexchange.com/"}))]))
|
||||||
(timeout 3000)
|
(timeout 3000)
|
||||||
|
(delete-node page "#adsense")
|
||||||
(p/all [(.type (.-keyboard page) "l")
|
(p/all [(.type (.-keyboard page) "l")
|
||||||
(timeout 1000)])
|
(timeout 1000)])
|
||||||
(let [path (get options :output-path (str "screenshot-"
|
(let [path (get options :output-path (str "screenshot-"
|
||||||
|
Loading…
Reference in New Issue
Block a user