Colly: Error compiling

Created on 5 Feb 2019  路  7Comments  路  Source: gocolly/colly

I am trying to build my project but I am having this strange error... does anyone have an idea why this would happen?

go build ./cmd/my_crawler
# my_crawler/vendor/github.com/gocolly/colly
vendor/github.com/gocolly/colly/colly.go:972:4: undefined: htmlquery.FindEach
vendor/github.com/gocolly/colly/xmlelement.go:137:3: undefined: htmlquery.FindEach
vendor/github.com/gocolly/colly/xmlelement.go:161:3: undefined: htmlquery.FindEach
make: *** [build] Error 2

Most helpful comment

until there is a tagged release, this seems to be the way to go: (using go modules)

$ go get -u github.com/gocolly/colly@b3032e87d3efbd3c00423aeb84f1fb7772c7d8a6

All 7 comments

the following dependency DOES exist in my vendor directory...

vendor/github.com/antchfx/htmlquery/query.go

From https://github.com/antchfx/htmlquery changelog:
2019-02-04
#7 Removed deprecated FindEach() and FindEachWithBreak() methods.

I added this to my Gopkg.toml :
[[constraint]]
name = "github.com/antchfx/htmlquery"
revision = "db5c1236cbb43c58add1164a8b20d844683e537f"

If I have some time I will make a pull request changing these calls...

seems to be fixed in c64a5846758a4620942e85daa6e8d969ea994d8f ! Thank you!

until there is a tagged release, this seems to be the way to go: (using go modules)

$ go get -u github.com/gocolly/colly@b3032e87d3efbd3c00423aeb84f1fb7772c7d8a6

Isn't it merged on the main branch?

It is fixed in 1.2.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icamys picture icamys  路  3Comments

mazhigali picture mazhigali  路  5Comments

x0rzkov picture x0rzkov  路  3Comments

zplzpl picture zplzpl  路  5Comments

dzakaammar picture dzakaammar  路  3Comments