(self, request, response)
| 30 | yield feapder.Request(url, task_id=task_id) |
| 31 | |
| 32 | def parse(self, request, response): |
| 33 | # 提取网站title |
| 34 | print(response.xpath("//title/text()").extract_first()) |
| 35 | # 提取网站描述 |
| 36 | print(response.xpath("//meta[@name='description']/@content").extract_first()) |
| 37 | print("网站地址: ", response.url) |
| 38 | |
| 39 | # mysql 需要更新任务状态为做完 即 state=1 |
| 40 | yield self.update_task_batch(request.task_id) |
| 41 | |
| 42 | |
| 43 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected