diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-28 21:58:44 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-28 21:58:44 +0530 |
commit | be1aaadc320f5ec5dc5f607aa2799e2ba90ae939 (patch) | |
tree | 42a6966a24a1c7310172a7eb93902827919290e4 /search.go | |
parent | c10fb3398376c7f6ccbbc676973832b34abef713 (diff) |
Diffstat (limited to 'search.go')
-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) { |