Run runs a Crawler. It returns the Task ID if successful.
(crawlerID string)
| 230 | // Run runs a Crawler. |
| 231 | // It returns the Task ID if successful. |
| 232 | func (c *Client) Run(crawlerID string) (string, error) { |
| 233 | var res TaskIDResponse |
| 234 | path := fmt.Sprintf("crawlers/%s/run", crawlerID) |
| 235 | |
| 236 | err := c.request(&res, http.MethodPost, path, nil, nil) |
| 237 | if err != nil { |
| 238 | return "", err |
| 239 | } |
| 240 | |
| 241 | return res.TaskID, nil |
| 242 | } |
| 243 | |
| 244 | // Pause pauses a Crawler. |
| 245 | // It returns the Task ID if successful. |