Skip to content

Instantly share code, notes, and snippets.

Created July 5, 2019 22:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
func main() {
htmlContent, err := ioutil.ReadFile("compositecode.html")
if err != nil {
htmlData := string(htmlContent)
r := strings.NewReader(htmlData)
doc, err := html.Parse(r)
if err != nil {
fmt.Fprintf(os.Stderr, "find links: %v\n", err)
for _, link := range visit(nil, doc) {
w, i, _ := CountWordsAndImages("")
fmt.Printf("Words: %d\nImages: %d\n", w, i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment