chuobus.go 500 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/PuerkitoBio/goquery"
  5. )
  6. func GetPage(url string) {
  7. doc, _ := goquery.NewDocument(url)
  8. doc.Find("div#tab1 table.wd_table tr").Each(func(_ int, s *goquery.Selection) {
  9. hour := s.Find("th").Text()
  10. fmt.Println(hour)
  11. fmt.Println("/")
  12. times := s.Find("td span").Text()
  13. fmt.Println(times)
  14. })
  15. }
  16. func main() {
  17. url := "http://www.bustei.com/timetable/index/2225/2348"
  18. GetPage(url)
  19. }