hocjooker@gmail.com 1 anno fa
parent
commit
9fb725da1d
1 ha cambiato i file con 15 aggiunte e 12 eliminazioni
  1. 15 12
      main.go

+ 15 - 12
main.go

@@ -11,9 +11,9 @@ import (
 
 func main() {
 	// Wordpress
-	url := "https://addand.kr/shop/new-%ed%95%9c-%ea%b6%8c%ec%9c%bc%eb%a1%9c-%eb%81%9d%eb%82%98%eb%8a%94-%eb%85%b8%ec%85%98/"
+	// url := "https://addand.kr/shop/new-%ed%95%9c-%ea%b6%8c%ec%9c%bc%eb%a1%9c-%eb%81%9d%eb%82%98%eb%8a%94-%eb%85%b8%ec%85%98/"
 
-	// url := "https://seoulknit.com/shop/collar-half-sleeved-top_blue/"
+	url := "https://seoulknit.com/shop/collar-half-sleeved-top_blue/"
 	// Send an HTTP GET request to the URL
 	response, err := http.Get(url)
 	if err != nil {
@@ -57,17 +57,20 @@ func main() {
 	fmt.Println("Email: ", findEmail(doc.Find(cEmail).First().Text(), ""))
 	fmt.Println("Rating : ", doc.Find(cRating).First().Text())
 
-	doc.Find("link ~ meta").Each(func(i int, s *goquery.Selection) {
+	doc.Find("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(v, " : ", s.AttrOr("content", ""))
+
+		// 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 : ")