aboutsummaryrefslogtreecommitdiff
path: root/search.go
diff options
context:
space:
mode:
Diffstat (limited to 'search.go')
-rw-r--r--search.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/search.go b/search.go
index 2c9d40d..c018f0a 100644
--- a/search.go
+++ b/search.go
@@ -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) {