Skip to content

Instantly share code, notes, and snippets.

@JSkally
Last active October 5, 2017 14:53
Show Gist options
  • Save JSkally/0e938f9d0f20ce94953fea8ced46c5df to your computer and use it in GitHub Desktop.
Save JSkally/0e938f9d0f20ce94953fea8ced46c5df to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"strings"
)
func crawl (url string) {
doc, err := goquery.NewDocument(url)
if err != nil {
fmt.Println("ERROR")
}
doc.Find("body > ul > li").Each(
func(i int, s *goquery.Selection){
symbol := s.Find("a").Text()
fmt.Println("Symbol: %s\n", strings.TrimSpace(symbol))
})
}
func main(){
crawl("https://www.jamstockex.com/ticker-data")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment