                                        0
                                        nodes)))
                                  0
-                                 xpaths-hrefs-text)
+                                 template-removed)
 
-           xpath-nav-info       (map
-                                 (fn [[xpath info]]
-                                   {:xpath xpath
-                                    :score (reduce
-                                            (fn [acc an-info]
-                                              (+ acc (:num-chars an-info)))
-                                            0
-                                            info)
+           xpath-nav-info       (filter
+                                 #(not
+                                   (or
+                                    (-> % :score zero?)
+                                    (-> % :hrefs count zero?)))
+                                 (map
+                                  (fn [[xpath info]]
+                                    {:xpath xpath
+                                     :score (reduce
+                                             (fn [acc an-info]
+                                               (+ acc (:num-chars an-info)))
+                                             0
+                                             info)
                                     
-                                    :hrefs (reduce
-                                            (fn [acc an-info]
-                                              (cons (:href an-info) acc))
-                                            '()
-                                            info)})
-                                 xpaths-anchors-chars)]
+                                     :hrefs (reduce
+                                             (fn [acc an-info]
+                                               (cons (:href an-info) acc))
+                                             '()
+                                             info)})
+                                  xpaths-anchors-chars))]
        
        {:total-nav-info page-wide-nav-chars
         :xpath-nav-info (sort-by :score xpath-nav-info)})))
+

                                 processed-pg
                                 url
                                 blacklist)
           xpaths-anchors-chars (map
                                 (fn [[xpath nodes]]
                                   [xpath (map

  (require [crawler.dom :as dom]))

(defn state-action
  "Args:
    page-src : the body
    url      : the source url
    template-removed: Xpath, Href pairs that we remove from the decision space"
  ([page-src url template-removed]
     (state-action page-src url template-removed []))

  ([page-src url template-removed blacklist]
     (let [processed-pg         (dom/html->xml-doc page-src)

           ; xpaths nodes and associated anchor-text
