From f0d75731e0db647903c8611d00c7b85002751317 Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Wed, 29 Jun 2016 08:59:28 -0400 Subject: [PATCH] fix example, closes #120 --- README.md | 6 ++++-- example_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b53a353..b6550fe 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,10 @@ func ExampleScrape() { log.Fatal(err) } - doc.Find(".reviews-wrap article .review-rhs").Each(func(i int, s *goquery.Selection) { - band := s.Find("h3").Text() + // Find the review items + doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { + // For each item found, get the band and title + band := s.Find("a").Text() title := s.Find("i").Text() fmt.Printf("Review %d: %s - %s\n", i, band, title) }) diff --git a/example_test.go b/example_test.go index 1698a2d..17b2354 100644 --- a/example_test.go +++ b/example_test.go @@ -16,9 +16,9 @@ func Example() { } // Find the review items - doc.Find(".reviews-wrap article .review-rhs").Each(func(i int, s *goquery.Selection) { + doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { // For each item found, get the band and title - band := s.Find("h3").Text() + band := s.Find("a").Text() title := s.Find("i").Text() fmt.Printf("Review %d: %s - %s\n", i, band, title) })