Pārlūkot izejas kodu

matching shpify

hocjooker@gmail.com 1 gadu atpakaļ
vecāks
revīzija
bf93290513
1 mainītis faili ar 28 papildinājumiem un 12 dzēšanām
  1. 28 12
      main.go

+ 28 - 12
main.go

@@ -11,9 +11,25 @@ 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://droppii.net.vn/cnd-ginseng-gold"
+	url := "https://bt-beloria-1.myshopify.com/collections/women-collection/products/sweater-classical-tshirt"
+	// url := "https://seoulknit.com/shop/v-neck-summer-pullover/"
+	// url = "https://www.elcanto.co.kr" //MakeShop
+	// url = "https://www.ippngirl.co.kr" //MakeShop
+	// url = "https://ssline.kr" //cafe24
+	// url = "https://koskomro.com" //cafe24
+	// url = "https://bt-beloria-1.myshopify.com" //shopify
+	// url = "https://lachinatakorea.com" //Godomall
+	// url = "https://sf-fd.com" //Godomall
+	// url = "https://www.vanillagift.com" //Magento
+	// url = "https://taiwan.coach.com" //Magento
+	// url = "http://mas1.magikthemes.com" //Magento
+	// url = "https://aladinmarket.co.kr" //young Cart
+	// url = "http://damoagift.com" //young Cart
+	// url = "https://p2u.daboryhost.com" /DaboryShop
+	// url = "https://seoulknit.com" //Woocommerce
+	// url = "http://webhost.dabory.com/" /Woocommerce
+	// url = "https://addand.kr" // WooCommerce
+	// url := "https://droppii.net.vn/cnd-ginseng-gold"
 	// Send an HTTP GET request to the URL
 	response, err := http.Get(url)
 	if err != nil {
@@ -27,18 +43,18 @@ func main() {
 	}
 
 	// These will the value of PDP parsing structures
-	cItemName := ".product_title"
-	cShortDesc := ".woocommerce-product-details__short-description"
-	cItemCategory := ".single-breadcrumbs-wrapper"
+	cItemName := ".product-single__title"
+	cShortDesc := ".product-single__description"
+	cItemCategory := ".product-single__sub-info:nth-of-type(1)"
 
-	cItemTags := ".tagged_as"
-	cItemImages := ".woocommerce-product-gallery__image a"
-	cItemTextDesc := "div.product-tabs-wrapper"
+	cItemTags := ".product-single__sub-info:nth-of-type(2)"
+	cItemImages := ".pg__thumb a"
+	cItemTextDesc := ".product-single__description"
 	// cItemOptions := "select#rating option"
-	cItemPrice := ".summary>.summary-inner>.price .woocommerce-Price-amount.amount"
+	cItemPrice := ".product-price-wrap>.product-price>.product-price__price"
 	cEmail := "footer"
 	cAddress := ".elementor-widget-container > p"
-	cRating := ".star-rating .rating"
+	cRating := ".pg__review-stars .spr-icon-star"
 	cAuthor := ".product-brand a"
 	cVideo := "iframe"
 
@@ -78,7 +94,7 @@ func main() {
 	fmt.Println("ItemImages: ")
 	doc.Find(cItemImages).Each(func(index int, element *goquery.Selection) {
 		img, _ := element.Attr("href")
-		imgs = append(imgs, img)
+		imgs = append(imgs, fmt.Sprintf("https://%v", img))
 	})
 	fmt.Println("", imgs)