Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions colly.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,16 +654,16 @@ func (c *Collector) scrape(u, method string, depth int, requestData io.Reader, c
if err := c.requestCheck(parsedURL, method, req.GetBody, depth, checkRevisit); err != nil {
return err
}
u = parsedURL.String()

c.wg.Add(1)
if c.Async {
go c.fetch(u, method, depth, requestData, ctx, hdr, req)
go c.fetch(method, depth, requestData, ctx, req)
return nil
}
return c.fetch(u, method, depth, requestData, ctx, hdr, req)
return c.fetch(method, depth, requestData, ctx, req)
}

func (c *Collector) fetch(u, method string, depth int, requestData io.Reader, ctx *Context, hdr http.Header, req *http.Request) error {
func (c *Collector) fetch(method string, depth int, requestData io.Reader, ctx *Context, req *http.Request) error {
defer c.wg.Done()
if ctx == nil {
ctx = NewContext()
Expand Down Expand Up @@ -1468,7 +1468,6 @@ func createMultipartReader(boundary string, data map[string][]byte) io.Reader {
}
buffer.WriteString(dashBoundary + "--\n\n")
return bytes.NewReader(buffer.Bytes())

}

// randomBoundary was borrowed from
Expand Down
1 change: 0 additions & 1 deletion unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func UnmarshalHTML(v interface{}, s *goquery.Selection, structMap map[string]str
if err := unmarshalAttr(s, attrV, st.Field(i)); err != nil {
return err
}

}
}

Expand Down