ngentotpw
Suka Semprot
- Daftar
- 29 Dec 2015
- Post
- 4
- Like diterima
- 7
Pingin nge share source code Go Lang buat nge download cerbung ke file berekstensi txt biar pas nge bacanya lebih enak, ga usah klik next terus 
install depedency-nya dulu pke command
go get -u github.com/gocolly/colly/...

install depedency-nya dulu pke command
go get -u github.com/gocolly/colly/...
Rich (BB code):
package main
import (
"fmt"
"os"
"github.com/gocolly/colly"
)
func main() {
URL_CERBUNG := "https://www.semprot.com/threads/pembantu-asik.1154808/page"
NUM_OF_PAGE := 26
// Init Colly
c := colly.NewCollector()
// Init File
f, _ := os.Create("cerbung.txt")
// What todo when colly finds a div with .myLTS class
c.OnHTML("div .myLiTS", func(e *colly.HTMLElement) {
f.WriteString(e.Text)
})
// whan colly finisher scrap
c.OnScraped(func(r *colly.Response) {
fmt.Printf("Finished %s \n", r.Request.URL)
})
j := 1
for j < NUM_OF_PAGE+1 {
c.Visit(fmt.Sprintf("%s-%d", URL_CERBUNG, j))
j += 1
}
}