package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"log"
)
func main() {
var links string = ""
doc, err := goquery.NewDocument("https://dev.bolshoi.ru/visit/buyingnew/")
if err != nil {
log.Fatal(err)
}
doc.Find("a:contains(\"График предварительной продажи билетов на декабрь 2023\")").Each(func(i int, s *goquery.Selection) {
link, _ := s.Attr("href")
fmt.Printf(link)
})
}
I just started learning the language, I don't understand well what needs to be done
Here is how you assign the link value to the outer links variable:
If there are multiple links you could make a slice: