
colly 出现 “invalid memory address or nil pointer dereference” 错误
在撰写 colly 的示例脚本时,你遇到了一些问题,导致出现以下错误信息:
“panic: runtime error: invalid memory address or nil pointer dereference”
具体错误出现在 colly.go 文件的第 55 行,归因于空指针引用。要解决此问题,请仔细检查第 55 行,确保任何指针引用均非 nil。
func main() {
c := colly.NewCollector()
c.OnHTML("img[src]", downloadImages)
c.Visit("https://example.com")
}










