diff options
-rw-r--r-- | search.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -41,8 +41,12 @@ func Search(q SearchQuery) ([]Entry, error) { case 0: entry.Category = e.ChildAttr("a", "title") case 1: - entry.URL = e.ChildAttr("a", "href") - entry.Title = e.ChildAttr("a", "title") + e.ForEach("a", func(_ int, e *colly.HTMLElement) { + if e.Attr("class") != "comments" { + entry.URL = e.Attr("href") + entry.Title = e.Text + } + }) case 2: e.ForEach("a", func(_ int, e *colly.HTMLElement) { switch(e.Index) { |