You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ch6-cloud/ch6-09-crawler.md
+41-81Lines changed: 41 additions & 81 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,16 +60,6 @@ func main() {
60
60
c.Visit(e.Request.AbsoluteURL(link))
61
61
})
62
62
63
-
// Before making a request
64
-
c.OnRequest(func(r *colly.Request) {
65
-
/*
66
-
r.Headers.Set("Cookie", "")
67
-
r.Headers.Set("DNT", "1")
68
-
r.Headers.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36")
69
-
r.Headers.Set("Host", "www.v2ex.com")
70
-
*/
71
-
})
72
-
73
63
err:= c.Visit("https://www.v2ex.com/go/go")
74
64
if err != nil {
75
65
fmt.Println(err)
@@ -101,97 +91,67 @@ nats 是 Go 实现的一个高性能分布式消息队列,适用于高并发
INFO {"server_id":"MNbZZUS4Ed5tvSaSRHyZS1","version":"1.3.0","proto":1,"go":"go1.10.3","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":31}
0 commit comments