From 851e204f54d2c16df96602b5e1fbba7251bbb1b0 Mon Sep 17 00:00:00 2001 From: SXueckShen Date: Thu, 12 Aug 2021 11:27:06 +0800 Subject: [PATCH 1/2] fix. google result div rules change --- search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.go b/search.go index 13c1d2f..c1ea127 100644 --- a/search.go +++ b/search.go @@ -313,7 +313,7 @@ func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Re linkText := strings.TrimSpace(linkHref) titleText := strings.TrimSpace(sel.Find("div > div > a > h3").Text()) - descText := strings.TrimSpace(sel.Find("div > div > div > span > span").Text()) + descText := strings.TrimSpace(sel.Find("div > div > div > span").Text()) if linkText != "" && linkText != "#" { result := Result{ From aaf8c77b45eb37403cf59eaaa0dda9a86c1b9ca8 Mon Sep 17 00:00:00 2001 From: SXueckShen Date: Thu, 12 Aug 2021 13:33:47 +0800 Subject: [PATCH 2/2] Update search.go --- search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.go b/search.go index c1ea127..4298e14 100644 --- a/search.go +++ b/search.go @@ -313,7 +313,7 @@ func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Re linkText := strings.TrimSpace(linkHref) titleText := strings.TrimSpace(sel.Find("div > div > a > h3").Text()) - descText := strings.TrimSpace(sel.Find("div > div > div > span").Text()) + descText := strings.TrimSpace(sel.Find("div > div > div > span:last-child").Text()) if linkText != "" && linkText != "#" { result := Result{