Created
February 24, 2014 15:55
-
-
Save wwwjfy/9190981 to your computer and use it in GitHub Desktop.
cron script to get daily deal of Kindle Store in Amazon China
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"github.com/PuerkitoBio/goquery" | |
) | |
func main() { | |
url := "http://www.amazon.cn/gp/feature.html?ie=UTF8&docId=126758" | |
resp, err := goquery.NewDocument(url) | |
if err != nil { | |
log.Fatal(err) | |
os.Exit(1) | |
} | |
fmt.Printf("Kindle Special:") | |
resp.Find("td.amabot_center div:nth-child(3) table tbody tr td div table tbody tr:nth-child(2) td:nth-child(odd)").Each(func(i int, s *goquery.Selection) { | |
fmt.Printf("%s ", s.Text()) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear,
Could You tell me how to using it > I want to upload to my server with this name: amazon-deal.go , but I run this file, no content display!
Thanks!