diff --git a/_examples/basic/basic.go b/_examples/basic/basic.go index cd7abf4c1..b3f37251b 100644 --- a/_examples/basic/basic.go +++ b/_examples/basic/basic.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/coursera_courses/coursera_courses.go b/_examples/coursera_courses/coursera_courses.go index 45544a383..08b8e1ebc 100644 --- a/_examples/coursera_courses/coursera_courses.go +++ b/_examples/coursera_courses/coursera_courses.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // Course stores information about a coursera course diff --git a/_examples/cryptocoinmarketcap/cryptocoinmarketcap.go b/_examples/cryptocoinmarketcap/cryptocoinmarketcap.go index aa92e39c8..812b7b8e3 100644 --- a/_examples/cryptocoinmarketcap/cryptocoinmarketcap.go +++ b/_examples/cryptocoinmarketcap/cryptocoinmarketcap.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/error_handling/error_handling.go b/_examples/error_handling/error_handling.go index 7ac9d8f54..7d9d3d797 100644 --- a/_examples/error_handling/error_handling.go +++ b/_examples/error_handling/error_handling.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/factba.se/factbase.go b/_examples/factba.se/factbase.go index 76edfc067..b5276b4b4 100644 --- a/_examples/factba.se/factbase.go +++ b/_examples/factba.se/factbase.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "strconv" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) var baseSearchURL = "https://factba.se/json/json-transcript.php?q=&f=&dt=&p=" diff --git a/_examples/google_groups/google_groups.go b/_examples/google_groups/google_groups.go index cbeb97e9c..d838a831d 100644 --- a/_examples/google_groups/google_groups.go +++ b/_examples/google_groups/google_groups.go @@ -7,7 +7,7 @@ import ( "os" "strings" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // Mail is the container of a single e-mail diff --git a/_examples/hackernews_comments/hackernews_comments.go b/_examples/hackernews_comments/hackernews_comments.go index 8859a5f3c..1ecc3086a 100644 --- a/_examples/hackernews_comments/hackernews_comments.go +++ b/_examples/hackernews_comments/hackernews_comments.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) type comment struct { diff --git a/_examples/instagram/instagram.go b/_examples/instagram/instagram.go index de2b21368..c514ce0e7 100644 --- a/_examples/instagram/instagram.go +++ b/_examples/instagram/instagram.go @@ -10,7 +10,7 @@ import ( "regexp" "strings" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // "id": user id, "after": end cursor diff --git a/_examples/local_files/local_files.go b/_examples/local_files/local_files.go index ba2b9865c..3473a67f5 100644 --- a/_examples/local_files/local_files.go +++ b/_examples/local_files/local_files.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/login/login.go b/_examples/login/login.go index eeadeba36..ab7a6b06d 100644 --- a/_examples/login/login.go +++ b/_examples/login/login.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/max_depth/max_depth.go b/_examples/max_depth/max_depth.go index 2e28e568c..d11af1805 100644 --- a/_examples/max_depth/max_depth.go +++ b/_examples/max_depth/max_depth.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/multipart/multipart.go b/_examples/multipart/multipart.go index d8809241f..e0f8707ba 100644 --- a/_examples/multipart/multipart.go +++ b/_examples/multipart/multipart.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func generateFormData() map[string][]byte { diff --git a/_examples/openedx_courses/openedx_courses.go b/_examples/openedx_courses/openedx_courses.go index 293637541..38b0aff25 100644 --- a/_examples/openedx_courses/openedx_courses.go +++ b/_examples/openedx_courses/openedx_courses.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // DATE_FORMAT default format date used in openedx diff --git a/_examples/parallel/parallel.go b/_examples/parallel/parallel.go index 837b85b20..c85abbade 100644 --- a/_examples/parallel/parallel.go +++ b/_examples/parallel/parallel.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/proxy_switcher/proxy_switcher.go b/_examples/proxy_switcher/proxy_switcher.go index 022699f47..4f0154483 100644 --- a/_examples/proxy_switcher/proxy_switcher.go +++ b/_examples/proxy_switcher/proxy_switcher.go @@ -4,8 +4,8 @@ import ( "bytes" "log" - "github.com/gocolly/colly" - "github.com/gocolly/colly/proxy" + "github.com/gocolly/colly/v2" + "github.com/gocolly/colly/v2/proxy" ) func main() { diff --git a/_examples/queue/queue.go b/_examples/queue/queue.go index ddf70a660..e6cacc3c2 100644 --- a/_examples/queue/queue.go +++ b/_examples/queue/queue.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/gocolly/colly" - "github.com/gocolly/colly/queue" + "github.com/gocolly/colly/v2" + "github.com/gocolly/colly/v2/queue" ) func main() { diff --git a/_examples/random_delay/random_delay.go b/_examples/random_delay/random_delay.go index d9f58a250..72b2c5374 100644 --- a/_examples/random_delay/random_delay.go +++ b/_examples/random_delay/random_delay.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/gocolly/colly" - "github.com/gocolly/colly/debug" + "github.com/gocolly/colly/v2" + "github.com/gocolly/colly/v2/debug" ) func main() { diff --git a/_examples/rate_limit/rate_limit.go b/_examples/rate_limit/rate_limit.go index e17f4941f..82a0990b4 100644 --- a/_examples/rate_limit/rate_limit.go +++ b/_examples/rate_limit/rate_limit.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/gocolly/colly" - "github.com/gocolly/colly/debug" + "github.com/gocolly/colly/v2" + "github.com/gocolly/colly/v2/debug" ) func main() { diff --git a/_examples/reddit/reddit.go b/_examples/reddit/reddit.go index bd69f396d..30eb65d80 100644 --- a/_examples/reddit/reddit.go +++ b/_examples/reddit/reddit.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) type item struct { diff --git a/_examples/request_context/request_context.go b/_examples/request_context/request_context.go index b4b79b435..ace7edfbe 100644 --- a/_examples/request_context/request_context.go +++ b/_examples/request_context/request_context.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/scraper_server/scraper_server.go b/_examples/scraper_server/scraper_server.go index 6d0f0d85b..3c4bca6e9 100644 --- a/_examples/scraper_server/scraper_server.go +++ b/_examples/scraper_server/scraper_server.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) type pageInfo struct { diff --git a/_examples/shopify_sitemap/shopify_sitemap.go b/_examples/shopify_sitemap/shopify_sitemap.go index c769f37f4..e26d8a185 100644 --- a/_examples/shopify_sitemap/shopify_sitemap.go +++ b/_examples/shopify_sitemap/shopify_sitemap.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/url_filter/url_filter.go b/_examples/url_filter/url_filter.go index a4560f94c..a9210f127 100644 --- a/_examples/url_filter/url_filter.go +++ b/_examples/url_filter/url_filter.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/_examples/xkcd_store/xkcd_store.go b/_examples/xkcd_store/xkcd_store.go index e77a6cff6..f549885be 100644 --- a/_examples/xkcd_store/xkcd_store.go +++ b/_examples/xkcd_store/xkcd_store.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/cmd/colly/colly.go b/cmd/colly/colly.go index 8ad240a37..be58a571d 100644 --- a/cmd/colly/colly.go +++ b/cmd/colly/colly.go @@ -29,7 +29,7 @@ var scraperHeadTemplate = `package main import ( "log" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) func main() { diff --git a/colly.go b/colly.go index ac7055257..7b0b8a5e2 100644 --- a/colly.go +++ b/colly.go @@ -41,8 +41,8 @@ import ( "github.com/PuerkitoBio/goquery" "github.com/antchfx/htmlquery" "github.com/antchfx/xmlquery" - "github.com/gocolly/colly/debug" - "github.com/gocolly/colly/storage" + "github.com/gocolly/colly/v2/debug" + "github.com/gocolly/colly/v2/storage" "github.com/kennygrant/sanitize" "github.com/temoto/robotstxt" "google.golang.org/appengine/urlfetch" @@ -368,7 +368,7 @@ func Debugger(d debug.Debugger) CollectorOption { // Init initializes the Collector's private variables and sets default // configuration for the Collector func (c *Collector) Init() { - c.UserAgent = "colly - https://github.com/gocolly/colly" + c.UserAgent = "colly - https://github.com/gocolly/colly/v2" c.MaxDepth = 0 c.store = &storage.InMemoryStorage{} c.store.Init() diff --git a/colly_test.go b/colly_test.go index 5aa27c4e3..a6c88eaa1 100644 --- a/colly_test.go +++ b/colly_test.go @@ -27,7 +27,7 @@ import ( "github.com/PuerkitoBio/goquery" - "github.com/gocolly/colly/debug" + "github.com/gocolly/colly/v2/debug" ) var serverIndexResponse = []byte("hello world\n") diff --git a/extensions/random_user_agent.go b/extensions/random_user_agent.go index 41ebffe21..4c7afa2da 100644 --- a/extensions/random_user_agent.go +++ b/extensions/random_user_agent.go @@ -4,7 +4,7 @@ import ( "fmt" "math/rand" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) var uaGens = []func() string{ diff --git a/extensions/referer.go b/extensions/referer.go index 6b13a32a3..32a1c69ea 100644 --- a/extensions/referer.go +++ b/extensions/referer.go @@ -1,7 +1,7 @@ package extensions import ( - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // Referer sets valid Referer HTTP header to requests. diff --git a/extensions/url_length_filter.go b/extensions/url_length_filter.go index 695b74e57..141cfb57d 100644 --- a/extensions/url_length_filter.go +++ b/extensions/url_length_filter.go @@ -1,7 +1,7 @@ package extensions import ( - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) // URLLengthFilter filters out requests with URLs longer than URLLengthLimit diff --git a/go.mod b/go.mod index 038dc96f1..eae88c7d2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gocolly/colly +module github.com/gocolly/colly/v2 go 1.12 diff --git a/go.sum b/go.sum index c4bd9d3d7..a2bdef5fc 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/jawher/mow.cli v1.1.0 h1:NdtHXRc0CwZQ507wMvQ/IS+Q3W3x2fycn973/b8Zuk8= diff --git a/proxy/proxy.go b/proxy/proxy.go index bff40fb67..1b76581ef 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -20,7 +20,7 @@ import ( "net/url" "sync/atomic" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) type roundRobinSwitcher struct { diff --git a/queue/queue.go b/queue/queue.go index f7a133d3b..0ba69019c 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -5,7 +5,7 @@ import ( "sync" "sync/atomic" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" ) const stop = true diff --git a/xmlelement_test.go b/xmlelement_test.go index ac7a1aeca..90a434826 100644 --- a/xmlelement_test.go +++ b/xmlelement_test.go @@ -16,7 +16,7 @@ package colly_test import ( "github.com/antchfx/htmlquery" - "github.com/gocolly/colly" + "github.com/gocolly/colly/v2" "reflect" "strings" "testing"