|
@@ -56,6 +56,20 @@ func main() {
|
|
fmt.Println("ItemPice: ", doc.Find(cItemPrice).First().Text())
|
|
fmt.Println("ItemPice: ", doc.Find(cItemPrice).First().Text())
|
|
fmt.Println("Email: ", findEmail(doc.Find(cEmail).First().Text(), ""))
|
|
fmt.Println("Email: ", findEmail(doc.Find(cEmail).First().Text(), ""))
|
|
fmt.Println("Rating : ", doc.Find(cRating).First().Text())
|
|
fmt.Println("Rating : ", doc.Find(cRating).First().Text())
|
|
|
|
+
|
|
|
|
+ doc.Find("link ~ meta").Each(func(i int, s *goquery.Selection) {
|
|
|
|
+ v, _ := s.Attr("property")
|
|
|
|
+ if v == "og:description" {
|
|
|
|
+ fmt.Println("og:description : ", s.AttrOr("content", ""))
|
|
|
|
+ } else if v == "og:title" {
|
|
|
|
+ fmt.Println("og:title : ", s.AttrOr("content", ""))
|
|
|
|
+ } else if v == "og:image" {
|
|
|
|
+ fmt.Println("og:image : ", s.AttrOr("content", ""))
|
|
|
|
+ } else if v == "product:price:currency" {
|
|
|
|
+ fmt.Println("currency : ", s.AttrOr("content", ""))
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
fmt.Println("Author : ")
|
|
fmt.Println("Author : ")
|
|
doc.Find(cAuthor).Each(func(index int, element *goquery.Selection) {
|
|
doc.Find(cAuthor).Each(func(index int, element *goquery.Selection) {
|
|
link, _ := element.Attr("href")
|
|
link, _ := element.Attr("href")
|