Created
April 24, 2016 14:30
-
-
Save mdk-aza/f1ea3856683333c39e28ce736749749f to your computer and use it in GitHub Desktop.
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 ( | |
"github.com/PuerkitoBio/goquery" | |
"fmt" | |
"io/ioutil" | |
"os" | |
) | |
func main() { | |
url := "http://minamiichikawa.jp/pg214.html" | |
WritePage(url) | |
} | |
func WritePage(url string) { | |
doc, err := goquery.NewDocument(url) | |
if err != nil { | |
fmt.Print("url scarapping failed") | |
} | |
res, err := doc.Find("body").Html() | |
if err != nil { | |
fmt.Print("dom get failed") | |
} | |
ioutil.WriteFile("WebCrowler/html/pg214.html", []byte(res), os.ModePerm) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment